【发布时间】:2011-04-22 22:13:22
【问题描述】:
在我的代码中,我正在执行以下操作:
-(void)pushCropImageViewControllerWithDictionary:(NSDictionary *)dictionary {
civc = [[CropImageViewController alloc] init];
[self presentModalViewController:civc animated:YES];
civc.myImage.image = [dictionary objectForKey:UIImagePickerControllerOriginalImage];
}
所以我的应用中有一个模态视图。当这个模态视图消失时,我想从父视图(调用 pushCropImageViewControllerWithDictionary 的视图)调用一个方法,如下所示:
-(void)viewWillDisappear:(BOOL)animated {
[super viewWillAppear:animated];
[(AddNewItemViewController *)self.parentViewController addCroppedPicture:screenshot];
}
但它不断崩溃并显示以下消息:
由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[UITabBarController addCroppedPicture:]:无法识别的选择器发送到实例 0x4d15930”
谁能告诉我我做错了什么?我包含了 AddNewItemViewController 的标题,因此应该可以识别选择器。有人可以帮我看看我该如何正确地做到这一点吗?谢谢。
编辑:addCroppedPicture 声明:
-(void)addCroppedPicture:(UIImage *)image;
到目前为止,实现本身是空的。
【问题讨论】:
-
你能发布 addCroppedPicture 的声明吗?
标签: iphone objective-c ios ios4