Not exactly what I am doing wrong here but I create an array of dictionaries from a .plist file and it appears to all work perfectly. I can access the files in it without any issues but when I try to call [array length] I get two warnings.
'NSArray' may not respond to '-length'
'Comparison between pointer and integer'
I cant tell what I am doing wrong here as I have called length a million times before. I am calling 'length' in a for loop, plugging the exact number by hand works but it will not always work since I can't know the size of the array in advance. Heres my code for initializing the array and the start of the for loop. Can someone please explain what I got wrong?
I have used breakpoints / other debug code and can verify that the line in question is what is causing the problem. When this line is run I get "SIGABRT" any help would be greatly appreciated.
'NSArray' may not respond to '-length'
'Comparison between pointer and integer'
I cant tell what I am doing wrong here as I have called length a million times before. I am calling 'length' in a for loop, plugging the exact number by hand works but it will not always work since I can't know the size of the array in advance. Heres my code for initializing the array and the start of the for loop. Can someone please explain what I got wrong?
Code:
NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfURL:[NSURL URLWithString: @"http://web.suffieldacademy.org/~12clm/data.plist"]];
NSArray *people = [dictionary valueForKey:@"People"];
AppDelegate_Shared *appDelegate =
[[UIApplication sharedApplication] delegate];
NSManagedObjectContext *context = [appDelegate managedObjectContext];
NSError *error;
//ISSUE HAPPENS HERE!!!!
for (int i = 0;i<[people length]; i++) {
I have used breakpoints / other debug code and can verify that the line in question is what is causing the problem. When this line is run I get "SIGABRT" any help would be greatly appreciated.