I’m new to Xcode. what i want is read plist data locally in my program. i got
NSArrayM insertObject:atIndex:]: object cannot be nil error. Here is what i declared and my plist file. Thanks
NSMutableArray *phoneArray;
NSString *path=[[NSBundle mainBundle] pathForResource:@"PhoneList" ofType:@"plist"];
phoneArray= [[NSMutableArray alloc]initWithContentsOfFile:path];
key type
Item 0 Dictionary
Item 1 Dictionary
Items have description, name keys as type of String.
Verify your plist, there is most likely a bad value. Items in an
NSArrayorNSDictionarycan not be null. You can use Xcode to open the plist file to verify it.Personally I use “PlistEdit Pro”, it can provide somewhat better diagnostics when the plist is invalid. There is a Free Trial here of PlistEdit Pro.