Assigning to id from incompatible type ''CameraVIewController*'' warning showing at the below code
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
Actually, I think the real reason is that you miss the protocol "UINavigationControllerDelegate"
in UIImagePickerController.h you can see the delegate define:
@property(nonatomic,assign) id <UINavigationControllerDelegate, UIImagePickerControllerDelegate> delegate;
So if you want to assign delegate like this:
picker.delegate = self;
the self viewController must implement both UINavigationControllerDelegate and UIImagePickerControllerDelegate
If you only implement UIImagePickerControllerDelegate, you can not find any error literal, but you will get a warning "Assigning to id from incompatible type ''CameraVIewController''*", add UINavigationControllerDelegate to your viewController's protocol declaration shall get rid of it.
It's a very late answer, but I just met and solved it, hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With