我正在创建一个iPad应用程序,并且有两个类:NWRootViewController : UITableViewController
和UINewFeedViewController : UIViewController
。在NWRootViewController
中,我有一个UIBarButtonItem
,当点击它时,会弹出一个名为NWNewFeedViewController
的模式 View Controller :
// THIS CODE IS IN NWROOTVIEWCONTROLLER.M
// New Feed
-(IBAction)showNewFeedViewAction:(id)sender {
[newFeedViewController setModalPresentationStyle:UIModalPresentationFormSheet];
[self presentModalViewController:newFeedViewController animated:YES];
}
这很好。但是,在
NWNewFeedViewController
的 View 中,我还有另一个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
)
谁能帮我?谢谢
最佳答案
您的“取消”按钮具有您的详细信息 Controller 的目标;您的目标是定位新的Feed Controller 。因此,请检查您如何配置取消按钮。
关于iphone - dismissModalViewControllerAnimated使我的应用程序崩溃:(,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2613071/