【发布时间】:2012-04-11 06:53:30
【问题描述】:
函数调用有问题:
[self dismissModalViewControllerAnimated:YES];
在 MainViewController 中,我可以启动一个图像选择器并像往常一样通过单击取消按钮来关闭。
(IBAction) LaunchInMain:(id)sender{
MainAppDelegate *app = (MainAppDelegate *)[[UIApplication sharedApplication] delegate];
//elcPicker is a customized image picker
[app.viewController presentModalViewController:elcPicker animated:YES];
[elcPicker release];
[albumController release];
- (void)elcImagePickerControllerDidCancel:(ELCImagePickerController *)picker {
[self dismissModalViewControllerAnimated:YES];
}
现在,我不是直接在 Main 中启动它,而是先添加一个子视图,然后使用相同的启动方法从子视图启动图像选择器。
问题:
无法关闭图像选择器并且无法再次显示子视图。所以无论我点击什么,屏幕都将保留在图像选择器中。
我一直在尝试其他一些电话,例如没有任何成功:
[self dismissModalViewControllerAnimated:YES];
我对任何帮助或想法都很满意。如果您认为应该提供更多信息,我可以添加更多代码。
【问题讨论】:
-
你确定自己是你的elcPicker吗?试试 [elcPicker dismissModalViewControllerAnimated:YES];
标签: iphone ios xcode modalviewcontroller subview