You can't directly assign an NSNumber
to an NSString
value (the label's text
property).
You need to convert the number to a string first.
The best option is to use an NSNumberFormatter
so the number appears properly given the user's locale.
NSNumber *val = object[@"foo"];
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
// configure the formatter as needed
NSString *str = [formatter stringFromNumber:val];
cell.detailTextLabel.text = str;
Though you may get acceptable results by simply doing:
cell.detailTextLabel.text = [object[@"foo"] stringValue];