user757812
user757812

Reputation: 591

read plist iphone sdk

I am trying to read a plist file using this -

NSData *data = [NSData dataWithContentsOfFile:SettingsFilePath];

NSPropertyListFormat format;
NSArray *array = [NSPropertyListSerialization propertyListFromData:data mutabilityOption:NSPropertyListImmutable format:&format errorDescription:nil];

but its not working.. is there any other way of doing this?

Upvotes: 0

Views: 709

Answers (2)

fearmint
fearmint

Reputation: 5334

Try + (id)arrayWithContentsOfFile:(NSString *)aPath to load it.

Upvotes: 0

Saurabh
Saurabh

Reputation: 22893

try with this way -

  NSArray *arr= [[NSArray alloc] initWithContentsOfFile:plistPath];

Upvotes: 2

Related Questions