Skip to content

Instantly share code, notes, and snippets.

@kdxu
Created November 28, 2014 11:54
Show Gist options
  • Save kdxu/7eeb10d7971c8e2223b0 to your computer and use it in GitHub Desktop.
Save kdxu/7eeb10d7971c8e2223b0 to your computer and use it in GitHub Desktop.
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
// Pathを取得
UIImage *pickedImage = (UIImage *)[info objectForKey:UIImagePickerControllerOriginalImage];
if (pickedImage) {
NSData *data = [[NSData alloc] initWithData:UIImagePNGRepresentation(pickedImage)];
[DBAccess updatePic:@{@"cl_id":[NSString stringWithFormat:@"%d",cl_id], @"pic":data}];
}
// モーダルビューを閉じる
if (![_cameraviewcontroller.presentedViewController isBeingDismissed]) {
[_cameraviewcontroller dismissViewControllerAnimated:YES completion:nil];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment