4
我想用照相機捕獲照片後用相機保存帶有按鈕的照片,但我不知道爲什麼我的照片無法在照片庫保存!使用UIImageWriteToSavedPhotosAlbum將圖像保存到相機膠捲
這裏是我的代碼:
-(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
是UIImagePickerController
和img
是UIIMageView
。
我的問題是什麼?