0

I am using NSCoding to save a serialized list of my object. This object's successfully saved in the path:

/var/mobile/Applications/F923C87-360D-4B429-B2E9-CAE121009ECE5/Documents/feed_file

And I can get the object successfully when the app starts.

I'm looking to deploy the app with some contents already loaded, so I want to have a primary version of feed_file in the apps.

How can I do that, copy it the first time the app starts but not the other times?

Chris Kempen
  • 9,491
  • 5
  • 40
  • 52
Sqlumee
  • 1
  • 1

1 Answers1

0

Put a bit of code in applicationDidFinishLaunching:, check whether there is any file at the destination path (Documents/feed_file), if there isn't then copy the default file out of the bundle. The default file should be part of the Xcode project and copied to the bundle during the build.

Wain
  • 118,658
  • 15
  • 128
  • 151