i have this code in my program but it seems to be crashing the program and i cant figure out why.
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
//Get Image URL from Library
NSURL *urlPath = [info valueForKey:UIImagePickerControllerMediaURL];
NSString *urlString = [urlPath absoluteString];
NSLog(urlString);
NSURL *root = [[NSBundle mainBundle] bundleURL];
NSString *html;
html = @"<img src='";
html = [html stringByAppendingString:urlString];
html = [html stringByAppendingString:@"' />"];
[MemeCanvas loadHTMLString:html baseURL:root];
[picker dismissViewControllerAnimated:YES completion:^{}];
}
It seems to be caused around the section where i append the asset-library address (urlString) to the the html string. i dont know why this would give a problem.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFConstantString stringByAppendingString:]: nil argument'
Any help is appreciated.
Thanks in advance.
Does this link help? It explains that you will not get a URL for images but an image object instead.
UIImagePickerControllerMediaURL always nil for a photo