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
a source to share
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.
a source to share
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:..........];
a source to share