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);`
↧