xcode和objective-c的新手。所以请原谅我的菜鸟错误,但我已经有这个错误“'NSInvalidArgumentException',原因:'-[UIView isAnimating]: unrecognized selector sent to instance”已经有一天多了,并且已经做了很多搜索但没有成功。清理/构建应用程序时没有错误,但是当我单击按钮加载“UIIMagePickerController”时,应用程序终止并引发错误。请帮忙。谢谢
- (void)showImagePickerForSourceType:(UIImagePickerControllerSourceType)sourceType
{
if (self.imageView.isAnimating)
{
[self.imageView stopAnimating];
}
if (self.capturedImages.count > 0)
{
[self.capturedImages removeAllObjects];
}
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePickerController.sourceType = sourceType;
imagePickerController.delegate = self;
if (sourceType == UIImagePickerControllerSourceTypeCamera)
{
imagePickerController.showsCameraControls = NO;
[[NSBundle mainBundle] loadNibNamed:@"OverlayView" owner:self options:nil];
self.overlayView.frame = imagePickerController.cameraOverlayView.frame;
imagePickerController.cameraOverlayView = self.overlayView;
self.overlayView = nil;
}
self.imagePickerController = imagePickerController;
[self presentViewController:self.imagePickerController animated:YES completion:nil];
}