So I\'ve searched, and read and have done this successfully before, but am running into a problem with this one.
I have a plist that is an array of strings. I get n
NSString *plistPath = [self copyFileToDocumentDirectory:plistFileName];
NSDictionary *plistContents=[[NSDictionary alloc] initWithContentsOfFile:plistPath];
[plistPath release];
return plistContents;
PLists are dictionaries at their heart (notice the <dict> tag). Read the file into an NSDictionary, then ask the dictionary for the array using objectforKey:
method and the Root
key.
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:plistPath];
_brands = [dict objectForKey:@"Root"];