If you're initializing your array as
[NSMutableArray arrayWithObjects:@"Egg Benedict", @"Mushroom Risotto", @"Full Breakfast", @"Hamburger", @"Ham and Egg Sandwich", nil];
it's like, you're declaring your array with autorelease
.
[[[NSMutableArray alloc] initWithObjects:@"Egg Benedict", @"Mushroom Risotto", @"Full Breakfast", @"Hamburger", @"Ham and Egg Sandwich", nil] autorelease];
you don't know at which point, the array
will be released.
So you better stick to your second solution.
or else try with @property
way of declaring NSMutablearray
.