How can I access the int values of an object in an NSMutableArray?
Posted
by Daniel
on Stack Overflow
See other posts from Stack Overflow
or by Daniel
Published on 2010-04-25T15:37:47Z
Indexed on
2010/04/25
15:43 UTC
Read the original article
Hit count: 198
I try to access some values in a NSMutableArray I created, but I only get some numbers (address?) if I try to access them.
I was able to initialize an array and can add and change objects with
[myNSMutableArray addObject:[NSNumber numberWithInt:10]]
and
[myNSMutableArray replaceObjectAtIndex:0 withObject:[NSNumber numberWithInt:47]
I also can print the value at index [0] with
NSLog(@"%@", [myNSMutableArray objectAtIndex:0]);
and I get 47
as expected.
But how can I access the integer value of the object in the array so I can save it tomyIntValue
?
© Stack Overflow or respective owner