-(ibaction)takephoto { picker = [[uiimagepickercontroller alloc]init]; picker.delegate = self; [picker setsourcetype:uiimagepickercontrollersourcetypecamera]; [self presentedviewcontroller:picker animated:yes completion:nil]; } - (ibaction)chooseexisting { picker2 = [[uiimagepickercontroller alloc]init]; picker2.delegate = self; [picker2 setsourcetype:uiimagepickercontrollersourcetypecamera]; [self presentedviewcontroller:picker2 animated:yes completion:nil]; } - (void) imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info { image = [info objectforkey:uiimagepickercontrolleroriginalimage]; [imageview setimage:image]; [self dismissviewcontrolleranimated:yes completion:nil]; } - (void)imagepickercontrollerdidcancel:(uiimagepickercontroller *)picker { [self dismissviewcontrolleranimated:yes completion:null];
when try run app
[self presentedviewcontroller:picker animated:yes completion:nil];
gets highlighted in red saying no visible @interface viewcontroller declares sector presentedviewcontroller:animated :completion :
my .h file
@interface viewcontroller : uiviewcontroller <uiimagepickercontrollerdelegate, uinavigationcontrollerdelegate> { uiimagepickercontroller *picker; uiimagepickercontroller *picker2; uiimage *image; iboutlet uiimageview *imageview; } - (ibaction)takephoto; - (ibaction)chooseexisting;
you have typo: presentedviewcontroller
instead of presentviewcontroller
on line
[self presentedviewcontroller:picker animated:yes completion:nil];
(in more 1 place)
Comments
Post a Comment