Example

suggest change

1. Static data to be used in the app.

To store static data in a property list:

a) Add a new file

b) Click Property list in Resources

c) Name the property list. This example uses data.plist.

  1. You can create a plist of Arrays and Dictionaries as:

pathForResource:ofType: returns nil when data.plist is not in the app target, and then dictionaryWithContentsOfFile: returns nil. A property-list dictionary is immutable. The resource name must match the file name, without .plist.

NSDictionary *dictRoot = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"data" ofType:@"plist"]];
NSArray *arrayList = [dictRoot objectForKey:@"Object1"];

for (NSUInteger i = 0; i < [arrayList count]; i++) {
    NSDictionary *details = [arrayList objectAtIndex:i];
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents