I am using the following code to add NSNumber to a NSMutableArray
in header file:
NSNumber *timeInSeconds;
NSMutableArray *time;
in code:
int total=6;
timeInSeconds=[NSNumber numberWithInt:total];
[time addObject:timeInSeconds];
However, while debugging, I noticed that if I do
print (int) [time count]
I get an output of 0 … Not sure why this is happening…can anyone kindly help me ?
Thanks.
I don’t see where you allocated
time. At some point you need to callor some other allocation and initialization method.