NSURLRequest and NSOperationQueue
NSURLRequest and NSOperationQueue
- Subject: NSURLRequest and NSOperationQueue
- From: Dave DeLong <email@hidden>
- Date: Sat, 16 Jan 2010 15:32:51 -0700
Hi everyone,
I'm building an object that communicates with a server. For various reasons, I'd like to queue up all the NSURLRequests in an NSOperationQueue so that I never have more than one connection open at a time.
However, I'm running into a weird issue. If I create my NSURLRequest and open an NSURLConnection directly, then the connection works and everything proceeds as expected. However, if I create an NSInvocationOperation to delay the creation of the connection until the queue is idle, then the connection is created (and is non-nil), but the URLRequest never triggers any of its delegate methods.
After some investigation, I realized that the operation was executing on a different thread, so I scheduled the URLConnection on the mainRunLoop in the default mode (after unscheduling from the currentRunLoop). I'm also retaining the URLConnection in an ivar, but it's still not firing any delegate methods (on any thread).
Any ideas why my URL connection isn't working?
Thanks,
Dave DeLong
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden