objective c - NSNumber returning different value than the original int -


i quite new objective-c , trying convert int nsnumber can save core-data.

i've following piece of code (index nsinteger)

- (void) associateornottoaroutine:(nsstring*)exercisename associate:(bool)associate index:(nsinteger)index  nslog(@"number w index %d, %d",[nsnumber numberwithinteger:index],index); 

and returns

number w index 170413600, 2 

i need int of 2 translated number 2 along other numbers translated correct number... tell me why getting convertion? tried reading on nsnumber manual found nothing

try:

nslog(@"number w index %@, %d",[nsnumber numberwithinteger:index],index);                        ^^ 

the %@ format specifier call [nsnumber description] method, should return value after. original code return address of nsnumber object, not content.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -