I searched all topics about this issue but I couldn't find the answer.
I need to read a .txt file from a remote url and I use this
NSString *text = [[NSString alloc] initWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@paco2.txt", downloadURL]] usedEncoding:&encoding error:&error];
and download URL is
http://www.aaaaaa.com/
When I use the app in iOS6 or iOS7 works well, but in iOS5 the function returns nil.
The error is:
Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed. (Cocoa error 256.)" UserInfo=0x1081e7f0 {NSURL=http://www.aaaaaa.com/paco2.txt}
I'm going mad looking for the answer.