Hello,
I am having a bit of a difficulty understanding the error situation. Here is the code:
The imageData remains nil.
The 'data' returns following error message:
The operation couldnt be completed. (Cocoa error 256.)
What am I doing wrong and whats' the fix please ?
Thank you.
I am having a bit of a difficulty understanding the error situation. Here is the code:
Code:
NSURL *imageURL = [NSURL URLWithString:@"/Users/GOA/Desktop/present.png"];
NSError* error = nil;
NSData* data = [[NSData alloc] init];
data = [NSData dataWithContentsOfURL:imageURL options:NSDataReadingUncached error:&error];
if (error) {
NSLog(@"%@", [error localizedDescription]);
}
else
{
NSLog(@"Data has loaded successfully.");
}
UIImage *image = [UIImage imageWithData:imageData];
The imageData remains nil.
The 'data' returns following error message:
The operation couldnt be completed. (Cocoa error 256.)
What am I doing wrong and whats' the fix please ?
Thank you.