How to read data structure from .plist file into NSArray
I was creating a data structure manually using the following:
NSDictionary* league1 = [[NSDictionary alloc] initWithObjectsAndKeys: @"Barclays Premier League", @"name",
@"Premier League", @"shortname",
@"101", @"id", nil];
NSDictionary* league2 = [[NSDictionary alloc] initWithObjectsAndKeys: @"Coca-Cola Championship", @"name",
@"Championship", @"shortname",
@"102", @"id", nil];
NSDictionary* league3 = [[NSDictionary alloc] …
How to create PLIST files programmatically in iphone
I was looking to create plist file in my application Documents folder programmatically in objective C. I created a folder in documents directory :
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [paths objectAtIndex:0];
NSString *path = [NSString stringWithFormat:@"%@/Data.plist", documentsDirectoryPath];
…