I’m creating a plist in my iOS app that’s populated with some default values the first time the app runs (since the file doesn’t exist). Right now I’m trying to test a case after some of that information is changed. If I open the plist file in the iPhone simulator’s app’s documents folder (~/Library/Application Support/iPhone Simulator/4.2/Applications/SOME-LONG-HASH/Documents/mystuff.plist) in OS X’s Property List Editor, make my changes, and then save it, the iOS app can’t reread it and overwrites it as if it didn’t exist.
Is it not possible to edit an iOS plist or am I going about this wrong? I can’t seem to find anything in Apple’s docs.
For reference, I am saving an NSDictionary like this
[NSKeyedArchiver archiveRootObject:dict toFile:myFilePath];
And accessing it like this
NSDictionary *dict = [NSKeyedUnarchiver unarchiveObjectWithFile:myFilePath];
If your dictionary only contains strings, numbers, arrays, and dictionaries, you should use the NSDictionary methods writeToFile:atomically: and initWithContentsOfFile: to save and load the data. Your problem is probably caused by Property List Editor writing your file in the XML format while NSKeyedUnarchiver uses a binary format. You can specify the type if you Save As… in the application.