Reputation: 2991
Can anyone explain why this code is breaking my app:
NSMutableArray *myArray = [[NSMutableArray alloc] initWithObjects:@"recipeA", @"recipeA1", @"recipeA2", @"recipeA3",@"recipeA4",@"recipeA5",@"recipeA6",@"recipeA7",nil];
//these both break the app with invalid pointer type warnings
NSLog("What is 0: %@", [myArray objectAtIndex:0]);
NSLog("What is the count: %i", [myArray count]);
Upvotes: 2
Views: 118
Reputation:
You forgot the @
in front of the NSLog string:
NSLog(@"What is 0: %@", [myArray objectAtIndex:0]);
NSLog(@"What is the count: %i", [myArray count]);
Upvotes: 11