Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to keep .plist file in iphone app

I am developing an iPhone app, in which i want use an .plist file to save some config variables.

in my xcode where to create that .plist file and how to access it???

thank you,

like image 372
nbojja Avatar asked Jun 04 '09 04:06

nbojja


1 Answers

You would put in the resources folder. Then use something like this to load it:

NSString *file = [[NSBundle mainBundle] pathForResource:@"TwitterUsers" ofType:@"plist"];
NSArray *Props = [[NSArray alloc] initWithContentsOfFile:file];

Where TwitterUsers is the name of your plist file.

If your plist file contains keys and values you would make the second line an NSDictionary instead of NSArray.

like image 58
Solmead Avatar answered Sep 28 '22 08:09

Solmead