Reputation: 561
i use this code for taking a photo:
-(IBAction) getPhoto:(id) sender {
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
if((UIButton *) sender == choosePhotoBtn) {
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
} else {
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
}
[self presentModalViewController:picker animated:YES];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
}
and i want to know how i can save this photo that i take to the photo album.
Upvotes: 0
Views: 333
Reputation: 27073
Checkout the UIKit Function Reference, use:
UIImageWriteToSavedPhotosAlbum()
Usage:
UIImageWriteToSavedPhotosAlbum(theImage, nil, nil, nil);
Upvotes: 1