- I want to add objects to the property list I created which in my case called (highscoreArray) but what the problem I'm facing is that it adds the object then release it, in other words the next time I check the 'count' input it keeps showing only the number 1(see the Check method below) .
- Any solutions please ?
Code:
// Lazy Instantiation.
-(NSMutableArray *)highscoreArray
{
if(!_highscoreArray) _highscoreArray=[[NSMutableArray alloc]init];
return _highscoreArray;
}
-(void)Arraywithscores:(int)score
{ NSNumber *point = [NSNumber numberWithInt:score];
[self.highscoreArray addObject:point];
[self Check:self.highscoreArray];
}
-(void)Check:(NSMutableArray *)highscoreArray
{
NSLog(@"The number is %i",[highscoreArray count]);
}
- Any solutions please ?