I’m having trouble transferring a plist file into a mutable array so I can then use it to populate a table view. I created a plist called MyDeals.plist . I made the root an array and then added two dictionaries as subsets of that array and then populated those dictionaries with strings.
The code is as follows:
NSString *myfile = [[NSBundle mainBundle] pathForResource:@"MyDeals" ofType:@"plist"];
NSLog(@"%@", myfile);
NSMutableArray *myArray = [[NSMutableArray alloc] initWithContentsOfFile:myfile];
NSLog(@"%@", myArray);
self.dealsArray = myArray;
[myArray release];
The first NSLog logs out the correct path for the plist file so it works up until then but then the second log returns ‘(null)’ so myArray doesn’t actually grab the info from myfile for some reason. Any ideas? Thanks!
Try loading the file into an
NSDatafirst, so you can see what the problem is.