我正在尝试链接我的照片库以在 UIImageView 中显示图像,这将允许我添加过滤器,但是当您选择照片并点击“选择”时,应用程序崩溃。下面是我正在使用的代码;- (IBAction)chooseImage:(id)sender {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:picker animated:YES completion:nil];
}
错误在该行中:
"picker.delegate = self;"
并记为 *"Assigning to 'id' from in compatible type 'VSViewController const_strong'
如果有人对如何修复它或将运行的替代代码提出建议,我们将不胜感激。
请尽量避免使用过于复杂的语言,我是编码新手,这个问题让我沮丧了一段时间。