Assigning to id<UINavigationControllerDelegate,UIImagePickerControllerDelegate> from incompatible type CameraViewController*
चेतावनी के लिए नियत picker.delegate = self;
लाइनअसंगत प्रकार से 'आईडी <UINavigationControllerDelegate, UIImagePickerControllerDelegate>' 'CameraVIewController *' '
-(IBAction) getPhoto:(id) sender {
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
if((UIButton *) sender == takePhoto) {
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
} else {
//picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
}
[self presentModalViewController:picker animated:YES];
} के पास से पता चलता
[यह] [1] सबसे अच्छा जवाब है जिसे मैंने इस प्रश्न के लिए स्थापित किया है। [1]: http://stackoverflow.com/questions/4727895/iphone-uiimagepickercontrollerdelegate-inheritance –
अब मैंने देखा है कि आप भी UINavigationControllerDelegate प्रोटोकॉल के लिए अपने UIViewController आवंटित करने के लिए जरूरत है क्योंकि प्रलेखन UIImagePickerControllerDelegate के लिए इस का कहना है: @property (nonatomic, असाइन) आईडी प्रतिनिधि; तो इसका मतलब है कि आपको इन दोनों प्रोटोकॉल को असाइन करने की आवश्यकता है। –