iOS plist iOS Example:

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

1. Static data to be used in app.

To save static data in plist follow these methods:

a) Add a new file

enter image description here

b) Click Property list in Resources

enter image description here

c) Name the propertylist and a file will be created as(data.plist here)

enter image description here

d) You can create a plist of Arrays and Dictionaries as:

enter image description here

// Read plist from bundle and get Root Dictionary out of it

NSDictionary *dictRoot = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Data" ofType:@"plist"]];

// Your dictionary contains an array of dictionary // Now pull an Array out of it.

NSArray *arrayList = [NSArray arrayWithArray:[dictRoot objectForKey:@"Object1"]];

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


Got any iOS Question?