dataWithContentsOfURL error 256 in ios 6

2019-07-29 09:45发布

问题:

I have used the

[NSData dataWithContentsOfURL:url options:NSDataReadingUncached error:&error]

in my code on iOS 5 apps (using xcode 4.3)

Now I want to get data from the same URL but for ios 6 apps (using xcode 4.5) and it gives me the 256 error (read error (reason unknown))

Any ideas?

回答1:

As I said in the comments and it now seems that this was the answer.

the URL needs to be a properly formed URL with the proper http:// identifier.