iphone - Image not saving in photo Album -


i invoke uiimagepicker controller. when click camera button, preview , use button displaying, image not saving in photo album.

code:

-(void)viewdidappear:(bool)animated{      picker = [[uiimagepickercontroller alloc] init];       // set image picker source:     picker.sourcetype = uiimagepickercontrollersourcetypecamera;      // hide controls:     picker.showscameracontrols = yes;     picker.navigationbarhidden = yes;      // make camera view full screen:     picker.wantsfullscreenlayout = yes;      // insert overlay:     picker.cameraoverlayview = self.view;        self.view.backgroundcolor=[uicolor clearcolor];      // show picker:     [self presentmodalviewcontroller:picker animated:yes]; } 

use this

first set uiimagepickercontroller delegte self`

-(void)viewdidappear:(bool)animated{      picker = [[uiimagepickercontroller alloc] init]; picker.delegte = self ;      // set image picker source:     picker.sourcetype = uiimagepickercontrollersourcetypecamera;      // hide controls:     picker.showscameracontrols = yes;     picker.navigationbarhidden = yes;      // make camera view full screen:     picker.wantsfullscreenlayout = yes;      // insert overlay:     picker.cameraoverlayview = self.view;        self.view.backgroundcolor=[uicolor clearcolor];      // show picker:     [self presentmodalviewcontroller:picker animated:yes]; }       -(void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info          {          uiimage *image = [info objectforkey:@"uiimagepickercontrolleroriginalimage"];          uiimagewritetosavedphotosalbum(image,self,                                              @selector(image:finishedsavingwitherror:contextinfo:),                                            nil);         }      - (void)image:(uiimage *)image didfinishsavingwitherror:(nserror *)error contextinfo:(void *)contextinfo     {         uialertview *alert;           if (error)             alert = [[uialertview alloc] initwithtitle:@"error"                                                 message:@"unable save image photo album."                                                delegate:self cancelbuttontitle:@"ok"                                       otherbuttontitles:nil];         else              alert = [[uialertview alloc] initwithtitle:@"success"                                                 message:@"image saved photo album."                                                delegate:self cancelbuttontitle:@"ok"                                       otherbuttontitles:nil];         [alert show];         [alert release];     } 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -