照片存入图片库并打开图片库

1.存入图片库

例:

UIImageWriteToSavedPhotosAlbum(subImage, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);

- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo

{

    if (error != NULL)

    {

        NSLog(@"error");

    }

    else 

    {

       

    }

}

2.打开图片库

需要在头文件加两个代理

UINavigationControllerDelegate,UIImagePickerControllerDelegate


例:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];

imagePicker.delegate = self;

[self presentModalViewController:imagePicker animated:YES];

[imagePicker release];


你可能感兴趣的:(存入图片库,打开图片库)