iphone - core data for 'add to favorites' button? -


I have difficulty finding examples / tutorials / suggestions for this. I want to add 'Add to Favorites' button in my application . This will take a cell from a table view and populate that cell in the 'Favorites' table view. Is the core data appropriate direction for this near? I have seen some signs about using nsmutablearray and / or nsuserdefaults are not really sure any advice is appreciated how to go.

Core data is probably the best way to go if you need frequent store user session NSUserDefaults The user default - though I think it would be suitable to save, say, on the user's home page, in NSUserDefaults, which can be large (like favorites) probably should go to a data store.

If you do not ever need to search the list, and you want to save it and display, also see the Plist files. Write NSArray directly in the data with a write code in write a file with writeToFile Can: atomically: . You can send that data to arrayWithContentsOfFile: . .

If you go with the above approach, then to see one thing - arrayWithContentsOfFile: is static class method, not an example method.

Core data, however, is by far the most flexible option. For "Navigation-based App" with "Core Data", try the Template app in XCode, for example most code is correct.


Comments