{"id":29,"date":"2006-12-28T18:39:46","date_gmt":"2006-12-28T17:39:46","guid":{"rendered":"http:\/\/www.spikesoft.ch\/?p=29"},"modified":"2006-12-28T18:40:47","modified_gmt":"2006-12-28T17:40:47","slug":"how-to-use-predefined-header","status":"publish","type":"post","link":"https:\/\/www.spikesoft.ch\/?p=29","title":{"rendered":"How to use Predefined Header"},"content":{"rendered":"<p>Did you ever wonder what was this single file called <em>[YourProjectName]_Prefix.pch<\/em>.<\/p>\n<p><a class=\"imagelink\" title=\"prefix_pch.jpg\" href=\"http:\/\/www.spikesoft.ch\/wordpress\/upload\/2006\/12\/prefix_pch.jpg\"><img decoding=\"async\" id=\"image26\" alt=\"prefix_pch.jpg\" src=\"http:\/\/www.spikesoft.ch\/wordpress\/upload\/2006\/12\/prefix_pch.jpg\" \/><\/a><\/p>\n<p>Sure this look like a perfectly well formed Objective-C header, but did you ever try, for example, to use the <em>#define<\/em> precompiler directive in this file and then using the predefined keyword in one of your project&#8217;s classes. No Luck hey, it seems that this header is never read. Sound bizzare isn&#8217;t it.<\/p>\n<p>The answer is simply that, for a reason I can&#8217;t understand <a target=\"_blank\" href=\"http:\/\/www.apple.com\">Apple<\/a> , just forgot to configure properly the project template. Then we have to do it by ourself. Just go  to the <em>Project<\/em> menu and then select the <em>Edit Active Target &#8216;[YourProjectName]<\/em><em>&#8216; <\/em>(see below).<br \/>\n<a title=\"menu.jpg\" class=\"imagelink\" href=\"http:\/\/www.spikesoft.ch\/wordpress\/upload\/2006\/12\/menu.jpg\"><img decoding=\"async\" alt=\"menu.jpg\" id=\"image27\" src=\"http:\/\/www.spikesoft.ch\/wordpress\/upload\/2006\/12\/menu.jpg\" \/><\/a><\/p>\n<p>Finally correct the two <em>Prefix<\/em> build options such that it looks like below.<br \/>\n<a class=\"imagelink\" title=\"target_info.jpg\" href=\"http:\/\/www.spikesoft.ch\/wordpress\/upload\/2006\/12\/target_info.jpg\"><img decoding=\"async\" id=\"image30\" alt=\"target_info.jpg\" src=\"http:\/\/www.spikesoft.ch\/wordpress\/upload\/2006\/12\/target_info.jpg\" \/><\/a><\/p>\n<p>Now you&#8217;re done, enjoy the use of the centralized header.<\/p>\n<p>It seems also possible to modify the template in order to have this options directly set. <a target=\"_blank\" title=\"CocoaDev\" href=\"http:\/\/www.cocoadev.com\/index.pl?XcodeProjectTemplates\">CocoaDev<\/a> seems to be a good starting point for further investigations on the subject.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Did you ever wonder what was this single file called [YourProjectName]_Prefix.pch. Sure this look like a perfectly well formed Objective-C header, but did you ever try, for example, to use the #define precompiler directive in this file and then using &hellip; <a href=\"https:\/\/www.spikesoft.ch\/?p=29\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,8],"tags":[],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-macintosh","category-objective-c"],"_links":{"self":[{"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29"}],"version-history":[{"count":0,"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=\/wp\/v2\/posts\/29\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spikesoft.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}