我就是不明白:
我怎么能在 xcode 上“关闭”imagePickerController?这是打开相机的代码,它工作得很好..
-(IBAction) startcamera {
imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePickerController.allowsEditing = NO;
imagePickerController.showsCameraControls=NO;
imagePickerController.toolbarHidden=YES ;
imagePickerController.wantsFullScreenLayout=YES;
imagePickerController.cameraOverlayView=self.view;
self.imagePickerController.delegate=self;
[self presentModalViewController:imagePickerController animated:YES];
[imagePickerController release];
}
好的,假设我想通过单击按钮来关闭 imagePickerController(意味着不选择任何图像):我应该怎么做?试过:
-(IBAction)closecamera {
[imagePickerController release];
[imagePickerController dismissModalViewControllerAnimated:YES];
}
但它不起作用!有什么线索吗?提前致谢