-4

I am new in this field. So, can anyone explain how to use plist programmatically? From, where can I start , so that I can learn it properly?

1 Answers1

-1

You can access plist as same as NSDictionary. Plist provide data in key value formate.

-you can add your own plist file and use your plist as this way.

NSString *path = [[NSBundle mainBundle] pathForResource: @"plistname" ofType:@"plist"];
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile: path];

NSString *temp = [dict objectForKey:[NSString stringWithFormat:@"%@-Your key name",key]];
Developer
  • 65
  • 3
  • 2
    Or more concisely: `NSString *value = dict[key];`. There are two errors in your final line of code (3 if you include the fact the outer `stringWithFormat` is unnecessary). – trojanfoe Mar 03 '15 at 10:32