小编홍승욱*_*홍승욱的帖子

从不兼容类型'ViewController*const__strong'分配给'id <UINavigationControllerDelegate,UIImagePickerControllerDelegate>'

我的应用程序中有一个ImagePickerController.它运行良好,但旁边ipc.delegate = self;出现一条错误消息:

从不兼容的类型'ViewController*const__strong'分配给'id'

该应用程序运行良好,所以我忽略了错误消息,但我想我需要知道原因.为什么会出现错误消息?

ipc = [[UIImagePickerController alloc]init];
            ipc.modalPresentationStyle = UIModalPresentationCurrentContext;
            ipc.delegate = self;
            ipc.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
            [ipc setAllowsEditing:NO];
            [self presentViewController:ipc animated:NO completion:nil];
Run Code Online (Sandbox Code Playgroud)

xcode delegates incompatibletypeerror uiimagepickercontroller ios

7
推荐指数
2
解决办法
8197
查看次数