使用Master-Detail格式时出现问题。
我在AppDelegate.m中设置了以下代码
FileContent1 *bug4 = [[FileContent1 alloc] initWithTitle:@"Lady Bug"
url1:@"file:///Users/daemonwolf/Desktop/11.htm"
rating:1
thumbImage:[UIImage imageNamed:@"ladybugThumb.jpg"]
fullImage:[UIImage imageNamed:@"ladybug.jpg"]];
NSMutableArray *bugs = [NSMutableArray arrayWithObjects:bug1, bug2, bug3, bug4, nil];
UINavigationController * navController = (UINavigationController *) self.window.rootViewController;
MasterViewController * masterController = [navController.viewControllers objectAtIndex:0];
masterController.bugs = bugs;
在MasterViewController.h中,我设置了:
@property (strong) NSMutableArray *bugs;
并在MasterViewController.m中:
@implementation MasterViewController
@synthesize bugs = _bugs;
但是当我调试它时,我得到以下异常:
[UINavigationController setBugs:]:发送到无法识别的选择器 实例0x7179250 2013-06-20 23:38:01.406 EBS [4682:11303] * 由于未捕获的异常而终止应用程序 'NSInvalidArgumentException',原因:' - [UINavigationController setBugs:]:无法识别的选择器发送到实例0x7179250'
为什么会这样?