-(IBAction)addNumberToNumbersArray:(id)sender{
if (! [B][COLOR="red"][numbersArray count][/COLOR][/B]/* numbersArray is undefined in this scope. */ ){
NSMutableArray *numbersArray;
numbersArray = [[NSMutableArray alloc] init];
}
[B][COLOR="Red"]numbersArray[0]=1;[/COLOR][/B]
// 1. numbersArray is undefined in this scope.
/* 2. Your pointer, if it was even defined in this scope,
is to 1 NSMutableArray. Luckily, you're telling the computer you want to access
the content of memory at the current address so it won't have any ill effect.
However, you've just replaced your instance of NSMutableArray with the value 1.
Again, if it was even defined in this scope to begin with.*/
[B][COLOR="red"]}[/COLOR][/B]
/* Your "array", if you even managed to define it,
has just gone *poof*. Yes, it's gone, it's empty, it's not even
there anymore. All those numbers you assigned into it ? Gone
too. Scoping, Scoping, Scoping. */