Hello Gentlebeings,
I have a weird issue. Here is the setup:
- I have a NSOperationQueue which I add NSOperation subclass objects to. These do networking using NSURLConnection sendSynchronousRequest method. As I understand it, these are completely asynchronous, since they are NSOperations which each get their own thread.
- If I launch my app WITHOUT any background networking operations, loading a URL into a UIWebView works just fine.
If I launch my app, and run some background networking operations, loading a URL into a UIWebView results in this error:
Error Domain=WebKitErrorDomain Code=102 UserInfo=0x1996d60 "Frame load interrupted"
and any subesequent attempts to load a UIWebView fails with the same error.
Is there some weird interaction between UIWebView and NSURLConnection that I need to be aware of? My next step is to replace the synchronous calls with a fully async NSOperation, but it is such a weird bug that I figured I would ask the experts.
I have isolated the error down to the NSURLConnection sendSynchronousRequest method. If I call this from an NSOperation, UIWebView breaks horribly.
The 102 error has to do with some "Policy Changed" error in WebKit, which is poorly/non-documented anywhere.
Anybody have any idea? Any help is greatly appreciated!
EDIT: Looks like this is a cookie issue of some kind. Any reason why UIWebView would fail to load if the web server is setting a cookie via a background HTTP Request?