objective c - Problem retrieving data from array iphone? -
i declared nsmutablearray , assign object when retrieving object gives memory location.here code.
nsmutablearray *arrcondinum = [[nsmutablearray alloc] init]; [arrcondinum addobject:@"2"]; [arrcondinum addobject:@"4"]; [arrcondinum addobject:@"6"]; [arrcondinum addobject:@"8"]; for(int = 0;i<[arrcondinum count];i++){ nslog(@"array number %d",[arrcondinum objectatindex:i]); }
output gives
array number 20820
array number 20836
array number 20852
array number 20868
you add string in array, display it, have use %@:
nslog(@"array number %@",[arrcondinum objectatindex:i]);
in code (%d), display address of object.
%@ display description of objc object (return of -descriptionwithlocale:
or -description
)
Comments
Post a Comment