I add strings to an NSMutableArray and now I want to iterate that array:
NSEnumerator *e = [numbers objectEnumerator];
id object;
NSMutableString* theString = [NSMutableString string];
while (object = [e nextObject]) {
[theString appendString:[NSString stringWithFormat:@"%i;", object]];
}
But actually object does not seem to be the string I added to the array but just a number. How can I get the string?
"%i"is the format string for an integer, so it’s treating the object’s address as an integer. The format for an object is"%@".