我刚开始在iOS开发中,所以在我的第一个项目中,我正在开发一个简单的iOS应用程序来拍摄照片并将其显示在屏幕上.
- (IBAction)takePicture:(id)sender { UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.delegate = self; [self presentModalViewController:imagePicker animated:YES]; }
我收到以下警告:
Assigning to 'id<UINavigationControllerDelegate,UIImagePickerControllerDelegate>' from incompatible type 'todd_learningViewController *const __strong'
我不明白警告信息,不知道如何摆脱警告.
谢谢,
编辑:
我的头文件类似如下:
@interface todd_learningViewController : UIViewController <UIApplicationDelegate> - (IBAction)takePicture:(id)sender; @property (weak,nonatomic) IBOutlet UIImageView *pictureView; @end
我该怎么修改呢?
解决方法
原文地址:https://www.jb51.cc/c/114295.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。