Question

I have the following code in my file

NSString *filePath = [[NSBundle mainBundle]pathForResource:@"images" ofType:@"plist"];
                NSArray *array = [[NSArray alloc]initWithContentsOfFile:filePath];


                for (id dict in array) {


                    NSLog(@"This is the id: %@" ,[dict objectForKey:@"Id"]);

                }

When I run this on the debugger it comes back saying 'invalid CfStringref' on the NSString *filePath line.

No matter what code I try I cannot get past this.

Any ideas?

Also the plist is a Array of dictionaries but I can't get to parse them since the code won't work

Was it helpful?

Solution

images.plist is not in your "Copy Bundle Resources" build phase, drag it in and run again.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top