我已经为我一直在制作的钻取表应用程序编写了一些代码,但该应用程序仅在运行时崩溃。Xcode 在构建应用程序时没有给我任何错误。调试器输出:
2012-10-18 10:58:26.513 秒[474:c07]-[NavController setItems:]: 无法识别的选择器>发送到实例 0xc217a00 2012-10-18 10:58:26.515 秒[474:c07] * 终止应用程序到期to uncaught exception >'NSInvalidArgumentException', reason: '-[NavController setItems:]: unrecognized selector sent >to instance 0xc217a00' * First throw call stack: (0x14b8022 0xeb8cd6 0x14b9cbd 0x141eed0 0x141ecb2 0x3fbe 0xe2a1e 0x41401 0x41670 0x41836 >0xbfc9dd8 0x4872a 0x19596 0x1a274 0x29183 0x29c38 0x1d634 0x13a2ef5 0x148c195 0x13f0ff2 >0x13ef8da 0x13eed84 0x13eec9b 0x19c65 0x1b626 0x1d40 0x1cd9) 终止调用抛出异常
我想我知道错误在于 NavController.m ,其中:
- (void)viewDidLoad
{
[super viewDidLoad];
NSString* path = [[NSBundle mainBundle] pathForResource:@"Data" ofType:@"plist"];
MasterViewController* root = (MasterViewController*)self.topViewController;
NSDictionary* thelist = [NSDictionary dictionaryWithContentsOfFile:path];
root.items = [thelist objectForKey:@"Items"];
root.navigationItem.title = [thelist objectForKey:@"name"];
}
顺便说一句,我制作了这样的数组项: (nonatomic, retain) NSArray* items;