我正在创建一个iPad应用,我有两个类:NWRootViewController : UITableViewController
和UINewFeedViewController : UIViewController
。在NWRootViewController
我有一个UIBarButtonItem
,当点击时会弹出一个名为NWNewFeedViewController
的模态视图控制器:
// THIS CODE IS IN NWROOTVIEWCONTROLLER.M
// New Feed
-(IBAction)showNewFeedViewAction:(id)sender {
[newFeedViewController setModalPresentationStyle:UIModalPresentationFormSheet];
[self presentModalViewController:newFeedViewController animated:YES];
}
这很好用。但是,在NWNewFeedViewController
的视图中,我有另一个UIBarButtonItem
在点按时执行此操作:
// THIS CODE IS IN NWNEWFEEDCONTROLLER.M
// Buttons
-(IBAction)cancelAction:(id)sender {
[self dismissModalViewControllerAnimated:YES];
}
当我点按此按钮时,应用程序崩溃:
2010-04-10 12:39:46.703 News[580:207] *** -[NWDetailViewController cancelAction:]: unrecognized selector sent to instance 0x4741110
2010-04-10 12:39:46.705 News[580:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NWDetailViewController cancelAction:]: unrecognized selector sent to instance 0x4741110'
2010-04-10 12:39:46.705 News[580:207] Stack: (
40878667,
2458187017,
41150267,
40613142,
40609810,
2776006,
4876265,
2776006,
3246293,
3255055,
3250242,
2899304,
2793965,
2825287,
49238396,
40419388,
40415304,
49232029,
49232226,
2817505
)
任何人都可以帮助我吗?感谢
答案 0 :(得分:2)
您的取消按钮具有您的详细控制器的目标;你打算瞄准你的新饲料控制器。因此,请检查您如何配置取消按钮。
答案 1 :(得分:-1)
您的应用正在尝试调用已发布的对象。按照here的说明启用僵尸对象,以找出试图访问的对象。