I am facing the Problem when I have updated my Xcode to 7.0 or iOS 9.0. Somehow it started giving me the Titled error
\"The resource could not be load
I managed to solve this with a combination of many of the mentioned options. I’ll include a checklist of all of the things I had to do to get this to work.
In short:
NSAllowsArbitraryLoads
to true for my watch extension (not my watch app).https
and not http
.Step one:
Firstly and most obviously I had to add an NSAppTransportSecurity
key as a dictionary in my watch extension’s info.plist
with a subkey called NSAllowsArbitraryLoads
as a boolean set to true. Only set this in the watch extension and not the watch app’s plist. Although take note that this allows all connections and could be insecure.
or
NSAppTransportSecurity
NSAllowsArbitraryLoads
Step two:
Then I had to make sure that the url I was trying to load was https
and not just http
. For any urls that were still http I used:
Swift:
let newURLString = oldURLString.stringByReplacingOccurrencesOfString("http", withString: "https")
Obj-C:
NSString *newURLString = [oldURLString stringByReplacingOccurrencesOfString:@“http” withString:@“https”];