Putting integers into a mutable array?

ksuther

Registered
How do I put numbers into a mutable array? It just gives me a warning of passing arg 1 of 'addObject:' from incompatible pointer type

The code looks like this:
temp = [string substringWithRange:tempRange];
tempInt = [temp intValue];
[freeSpaceArray addObject:tempInt];

Any ideas? :(
 
NSMutableArray is an array of objects, and integers aren't objects. You could make an instance of NSNumber with something like [NSNumber numberWithInt:5]

HTH,
F-bacher
 
Back
Top