SPIEGO MEGLIO LA MIA DOMANDA:
Voglio che ad un vettore venga aggiunto un oggetto ogni volta che clicco su un tasto.
IL PROBLEMA È CHE IL COUNT MI RISPONDE SEMPRE 1.
PERCHÈ?
Ho pensato che il *vettore andrebbe creato fuori dal metodo, ma non so dove.
AIUTO
codice:
-(IBAction)metodo: (id)sender{
NSMutableArray *vettore = [[NSMutableArray alloc] init];
Classe *oggetto = [[Classe alloc] init];
int condizione = 1;
if( condizione ){
[vettore insertObject:oggetto atIndex:0];
int n;
for(n=0;n<=[vettore count];n++){
NSLog(@"%i",n);
}
NSLog(@"COUNT: %i",[vettore count]);
} //FINE DELL'IF
NSLog(@"array: %@", vettore); //TEST
}