Objective-c – How to convert NSNumber to NSString

nsarraynsnumbernsstringobjective c

So I have an NSArray "myArray" with NSNumbers and NSStrings. I need them in another UIView so i go like this:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

DetailViewController *details = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:nil];
details.subjectText = [[myArray objectAtIndex:indexPath.row] objectForKey:@"subject"];

The subjectText works.
But how can I get the NSNumbers out of it? (I actually need them as strings…)
I would convert a NSString out of a NSNumber like this:
NSString *blah = [NSNumber intValue]. But I don't know how to set it up in the code above…

Best Answer

Try:

NSString *myString = [NSNumber stringValue];
Related Topic