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...

推荐答案

Try:

NSString *myString = [NSNumber stringValue];

Objective-c相关问答推荐

如何在没有 Interface Builder 的情况下创建 Cocoa 接口?

核心数据独特属性

如何在 iPhone 应用程序的 UINavigationBar 中添加图像

处理 ARC 中的指针对指针所有权问题

如何更改图像 tintColor

从 Unix 时间戳创建 NSDate

如何在另一个视图中获取视图的框架?

Objective-C 的 Eclipse 插件?

Crashlytics iOS - 记录捕获的异常

iOS 7 状态栏与 NavigationBar 冲突

如何测试生产推送通知?

使用情节提要的条件转场

判断 NSString 是否只是由空格组成

如何在 UIAlertController 中添加 textField?

@class 在 Objective-C 中做了什么?

如何判断数组是空还是空?

如何从 UIColor 对象中获取红绿蓝 (RGB) 和 alpha?

iPhone:如何确定线程是否是主线程?

如何将 UITableView 滚动到特定位置

使用 [NSDate date] 获取当前日期和时间