Save image to camera roll with UIImageWriteToSavedPhotosAlbum

Posted by Momeks on Stack Overflow See other posts from Stack Overflow or by Momeks
Published on 2010-03-29T15:00:22Z Indexed on 2010/03/29 15:03 UTC
Read the original article Hit count: 996

Filed under:
|

Hi , i try to save a photo with a button to camera roll after user capture a picture with Camera , but i dont know why my picture doesn't save at photo library !! here is my code :

-(IBAction)savePhoto{

    UIImageWriteToSavedPhotosAlbum(img.image,nil, nil, nil);

}

-(IBAction)takePic {

    ipc = [[UIImagePickerController alloc]init];
    ipc.delegate = self;
    ipc.sourceType = UIImagePickerControllerSourceTypeCamera; 
    [self presentModalViewController:ipc animated:YES];

}




- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

    img.image = [[info objectForKey:UIImagePickerControllerOriginalImage]retain];
    [[picker parentViewController]dismissModalViewControllerAnimated:YES];
    [picker release];   
}

ipc is UIImagePickerController and img is UIIMageView

what's my problem ?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about SDK