2

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]);
1

1 Answer 1

11

You forgot the @ in front of the NSLog string:

NSLog(@"What is 0: %@", [myArray objectAtIndex:0]);
NSLog(@"What is the count: %i", [myArray count]);
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. I knew it had to be something like that.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.