Search code examples
cocoacore-dataxcode4

Why does previously saved data not appear in opened document of Core Data app?


I have created the Core Data app that is outlined in this tutorial by Apple using XCode 4. All works fine however when I save the document and reopen it the document window is empty and no data is shown.

When I check the data file, I can actually see the saved data in the file (only for XML format as other formats are unreadable). This problem rises for all of the supported save formats (XML, binary and SQLLITE).

There are no stacktraces in the debugger. All looks fine...


Solution

  • Found it. You need to check the "Prepares content" checkbox on the controller (attributes inspector pane of the Array Controller) otherwise data is not shown.