Accessing plists on the iphone simulator

So, I started creating plist files using NSCoder, but as it evolves, 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 like:

  • application package
  • build directory
0


a source to share


3 answers


To put them in the ~ / Library / Application Support / iPhone Simulator / User / Applications / subfolder (where they will go if they are on a real device), you can use the following 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 place the file in the / Documents / folder of your application sandbox. Then you can find the file: ~ / Library / Application Support / iPhone Simulator / User / Applications / Application GUID / Documents /

Good luck.

+2


a source


wow that's dumb

found them at /



this simulator should not completely emulate a real telephone environment.

0


a source


If your layer is in the Document folder, specify the path as

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

      

else if your plist file is in the resource folder then give the resource folder path as

[[NSBundle mainbundle] pathforresources:..........];

      

0


a source







All Articles