Reputation: 185
When Following the CoreDataBooks sample code and implementing it into my app, I have reached a very odd bug/glitch with an NSNumber(Integer 16).
When I have the code
cell.detailTextLabel.text = [NSString stringWithFormat:@"%i", child.marblesneeded];
the detailTextLabel displays an odd string of numbers that changes every time I try to change the numbers. See Attached Image. Currently, it should display 0 but it displays 112917120.
Thanks!
Upvotes: 1
Views: 131
Reputation: 2425
NSNumber has a method to return you the number as string, which can be used as a label text, as follows:
cell.detailTextLabel.text = [child.marblesneeded stringValue];
Upvotes: 2
Reputation: 18488
Try this:
cell.detailTextLabel.text = [NSString stringWithFormat:@"%d", [child.marblesneeded intValue]];
Upvotes: 2