Yet another stupid newbie's question
Yet another stupid newbie's question
Hello list,
It's again around type conflicts, pointers and stuff... Probably I'm trying
to mix objects and c-style vars in a wrong way
I've done an array containing integers.
it's filled by:
...
[myArray addObject:[NSNumber numberWithInt:10]];
[myArray addObject:[NSNumber numberWithInt:123]];
[myArray addObject:[NSNumber numberWithInt:4]];
[myArray addObject:[NSNumber numberWithInt:56]];
...
A simple
for (index=0;index<max;index++) {
NSLog (@"debug --> %@", [myArray objectAtIndex:index]);
}
tells me that all values are stored fine.
Well, my question is, how can I do some mathematics (additions, comparing in
size) with this values???
int value=[myArray objectAtIndex:0] makes the compiler scream:
"assignment makes integer from pointer without a cast"... :-(
TIA,
Martin