Cocoa error 256 while stringWithContentsOfURL
Hi
On my app, I'm trying to get the content of a perl, which prints a database dump.
I do that with this code:
NSURL *location = [NSURL URLWithString:@"url.pl"];
if (location) {
NSError *error = nil;
recupContenu = [NSString stringWithContentsOfURL:location
encoding:NSUTF8StringEncoding
error:&error];
if (!error) {
//NSLog(@"value: %@", recupContenu);
NSLog(@"ok");
} else {
NSLog(@"Something went wrong %d, %@",
[error code],
[error localizedDescription]);
}
}
[pool drain];
It only work one time on three, and I get this error :Something went wrong 256, Operation could not be completed. (Cocoa error 256.).
What's wrong ? Does anyone have a clue?
Thanks
|