{"id":252,"date":"2006-11-24T17:55:56","date_gmt":"2006-11-24T21:55:56","guid":{"rendered":"http:\/\/auroralux.net\/blog\/2006\/11\/24\/closing-the-loop-on-core-recipes\/"},"modified":"2006-11-24T17:55:56","modified_gmt":"2006-11-24T21:55:56","slug":"closing-the-loop-on-core-recipes","status":"publish","type":"post","link":"https:\/\/fhmiv.net\/blog\/2006\/11\/24\/closing-the-loop-on-core-recipes\/","title":{"rendered":"Closing the loop on Core Recipes"},"content":{"rendered":"<p>A while back, I had <a href=\"http:\/\/auroralux.net\/blog\/2006\/09\/17\/problems-with-cocoa-core-data-core-recipes-example\/\">some problems<\/a> with Apple&#8217;s Core Data &#8216;Core Recipes&#8217; example. <\/p>\n<p>I couldn&#8217;t find anything on Google, so I emailed a friend of a friend at Apple, and ended up getting some VERY helpful troubleshooting tips from Matthew Firlik. I asked if I could post them and he said yes, so here we go: <\/p>\n<blockquote><p>\n However, I have seen these symptoms in the past when<br \/>\nthere was an incongruity between two settings &#8212; the &#8220;Product Name&#8221;<br \/>\nand the CFBundleExecutable for the application.  (These values should<br \/>\nbe the same, otherwise the Finder gets rather confused.)<\/p>\n<p>Try this:<\/p>\n<p>        &#8211; Open the CoreRecipes project, and expand the &#8220;Targets&#8221; group<br \/>\n        &#8211; Double-click on the &#8220;CoreRecipesApp&#8221; target to bring up the target<br \/>\ninspector<br \/>\n        &#8211; Enter &#8220;Product Name&#8221; in the search field to find the build setting<\/p>\n<p>The value should be &#8220;CoreRecipes&#8221;.  Now, if you click on the<br \/>\n&#8220;Properties&#8221; tab in the inspector, the executable will also be listed<br \/>\nin the topmost text field &#8212; and it should match (&#8220;CoreRecipes&#8221;).  For<br \/>\ngood measure, click the &#8220;Open Info.plist as File&#8221; button at the bottom<br \/>\nof that pane, and inspect the file &#8212; you should find the values in<br \/>\nthe file as well:<\/p>\n<p>        <key>CFBundleExecutable<\/key><br \/>\n        <string>CoreRecipes<\/string><\/p>\n<p>If you build the application, and then go to the Finder and &#8220;Show<br \/>\nPackage Contents&#8221;, you should be able to ensure the information<br \/>\nmatches.  The values in the &#8220;Info.plist&#8221; in the Contents directory<br \/>\nshould match name of the executable in the Contents\/MacOS directory.<br \/>\nA good thing to do is to drag the Info.plist from the build product<br \/>\nonto the Xcode icon (to open it), and then under the &#8220;Format&#8221; menu<br \/>\nselect &#8220;Parse as Property List&#8221; &#8212; that&#8217;ll ensure it&#8217;s a valid format.<\/p>\n<p>&#8211; &#8211; &#8211; &#8211; &#8211;<\/p>\n<p>Now, more recent project templates don&#8217;t actually put the executable<br \/>\nname into the Info.plist &#8212; at least, not directly.  They actually put<br \/>\nin:<\/p>\n<p>        <key>CFBundleExecutable<\/key><br \/>\n        <string>${EXECUTABLE_NAME}<\/string><\/p>\n<p>and then check the &#8220;Expand Build Settings in Info.plist&#8221; checkbox in<br \/>\nthe build settings for the target.  This tells Xcode to process the<br \/>\nInfo.plist file at build time and put the correct information into the<br \/>\nproperty list.  If the above didn&#8217;t show anything obvious, you might<br \/>\ntry changing the setting in the Info.plist and checking the build<br \/>\nsetting, to see if that might help.<\/p>\n<p>&#8211; &#8211; &#8211; &#8211; &#8211;<\/p>\n<p>If things still aren&#8217;t working, then a couple of other things to try:<\/p>\n<p>        &#8211; If you build the application, and then run from the Finder (double-<br \/>\nclick) rather than from Xcode, does it work correctly?<br \/>\n        &#8211; Does a basic Core Data application (built from the stock template<br \/>\nin Xcode) exhibit the same problem?<br \/>\n        &#8211; If you open the build settings for the application target, is the<br \/>\n&#8220;ZeroLink&#8221; option enabled?  And if so, do things work if you turn it<br \/>\noff?<br \/>\n        &#8211; If you change the store type in the -setupDefaultStore method in<br \/>\nthe AppDelegate class to NSSQLiteStoreType (rather than the XML<br \/>\nstore), does it work?\n<\/p><\/blockquote>\n<p>I got partway through the list and my problems with the example went away. I wasn&#8217;t as diligent as I should have been tracking which step actually fixed it, but was happy enough it worked! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>A while back, I had some problems with Apple&#8217;s Core Data &#8216;Core Recipes&#8217; example. I couldn&#8217;t find anything on Google, so I emailed a friend of a friend at Apple, and ended up getting some VERY helpful troubleshooting tips from &hellip; <a href=\"https:\/\/fhmiv.net\/blog\/2006\/11\/24\/closing-the-loop-on-core-recipes\/\">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":[],"categories":[1],"tags":[24],"_links":{"self":[{"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/posts\/252"}],"collection":[{"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/comments?post=252"}],"version-history":[{"count":0,"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/posts\/252\/revisions"}],"wp:attachment":[{"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/media?parent=252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/categories?post=252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fhmiv.net\/blog\/wp-json\/wp\/v2\/tags?post=252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}