0
votes

I'm creating a myDb.plist file in my resources folder and trying to read it, but it's not getting read. I'm using the following code.

NSString* plistPath = [[NSBundle mainBundle] pathForResource:@"myDb" ofType:@"plist"];
contentArray = [NSArray arrayWithContentsOfFile:plistPath];

contentArray is showing null.

What can I try to resolve this?

1
Are you sure myDb.plist is an array?kennytm
Thank you KennyTM for pointing out, it wasn't as array. I changed it.neha

1 Answers

0
votes

Make your plist data array and not dictionary. Dictionary also works but i tried with hit and trial. Also, print NSLog your data, if in case you need, to check the input from plist.