objective c - Snapshotting a view that has not been rendered results in an empty snapshot in iOS 7 -
in ios 8, when click open camera ipad mini gives warning
"snapshotting view has not been rendered results in empty snapshot"
i using below code open camera device.
- (ibaction)takephotograph:(uibutton *)sender { uiimagepickercontroller *picker = [[uiimagepickercontroller alloc] init]; picker.delegate = self; picker.allowsediting = yes; picker.sourcetype = uiimagepickercontrollersourcetypecamera; [self presentviewcontroller:picker animated:yes completion:null]; } - (void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info { uiimage *chosenimage = info[uiimagepickercontrollereditedimage]; [self.cmdtakephotograph setimage:chosenimage forstate:uicontrolstatenormal]; [picker dismissviewcontrolleranimated:yes completion:null]; imagetaken = 1; compress = 1; self.lblerrmsg.hidden = yes; } - (void)imagepickercontrollerdidcancel:(uiimagepickercontroller *)picker { [picker dismissviewcontrolleranimated:yes completion:null]; }
please suggest me solution remove warning.
hope helps you.
uiimagepickercontroller *imagepicker = [[uiimagepickercontroller alloc] init]; [imagepicker setsourcetype:uiimagepickercontrollersourcetypecamera]; [imagepicker setdelegate:self]; if ([self respondstoselector:@selector(presentviewcontroller:animated:completion:)]) { [imagepicker setshowscameracontrols:no]; [self presentviewcontroller:imagepicker animated:yes completion:^{ [imagepicker setshowscameracontrols:yes]; }]; } else { [imagepicker setshowscameracontrols:yes]; [self presentmodalviewcontroller:imagepicker animated:yes]; }
Comments
Post a Comment