Quantcast
Channel: Questions in topic: "xcode"
Viewing all articles
Browse latest Browse all 1047

Picking image from Camera Roll returns EXC_BAD_ACCESS

$
0
0
Hello! I have successfully managed to access my camera roll but when I pick an image, Xcode returns this error "Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)" This is my code: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSString *type = [info objectForKey:UIImagePickerControllerMediaType]; if ([type isEqualToString:(NSString *)kUTTypeImage]) { NSURL *urlimage = [info objectForKey:UIImagePickerControllerMediaURL]; NSLog(@"%@", urlimage); NSString *urlString = [urlimage absoluteString]; const char* cp = [urlString UTF8String]; strcpy(image_url_path, cp); } [self dismissViewControllerAnimated:YES completion:NULL]; UnitySendMessage(callback_game_object_name, callback_function_name, image_url_path); } The error points at the line ` strcpy(image_url_path, cp);`

Viewing all articles
Browse latest Browse all 1047

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>