views:

479

answers:

2

So I have started building plist files using NSCoder, but as I"m developing i want to look at them and see what data is being saved.

How do i find/access the plist files generated by my app in the simulator (and on the device when i get to that)

Places Ive looked:

  • application bundle
  • build directory
A: 

wow that is dumb,

found them at /

this simulator must not emulate the real phone environment well at all.

Bluephlame
+2  A: 

To put them into the ~/Library/Application Support/iPhone Simulator/User/Applications/ subfolder (where they would end up if they were on a real device), you could use the following piece of code in your application:

+ (NSString *)dataFilePath:(NSString *)filename {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];

return [documentsDirectory stringByAppendingPathComponent:filename];
}

This will put the file in the /Documents/ folder of your application's sandbox. You can then find the file back at: ~/Library/Application Support/iPhone Simulator/User/Applications/ Application GUID /Documents/

Good luck.

MiRAGe