I have a big database of data I want my app to install with, too big for NSDefaults, essentially it's too big for me to type in (it's computer generated).
I can easily serialize it into a hierarchial NSDictionary format and a pList, but I'm stumped on how to get that pList from my running app into a file that Xcode will include in app builds, and where to install it, etc.
I've tried dumping my pLists out with .description to try to just copy and paste them into an Xcode .plist file. But pList.description outputs in the format
Problem8 = {
Term1 = 3;
};
While the Plist files in Xcode require a format like
<key>Problem8</key>
<string>3</string>
<key>Term1</key>
Feeling pretty dumb here, I'm obviously missing something easy to get to the correct format, or to save them serialized to disc in a manner that Xcode will include in future builds.
If you have a dictionary, use writeToFile:atomically:
to save it to a file and initWithContentsOfFile:
to load it back in.
That said, if it's a lot of data, and particularly if you don't need all of it loaded all the time, consider saving a Core Data store and deploying that.