NSBlockOperation with +[sendSynchronousRequest sendSynchronousRequest:...] or async?
NSBlockOperation with +[sendSynchronousRequest sendSynchronousRequest:...] or async?
- Subject: NSBlockOperation with +[sendSynchronousRequest sendSynchronousRequest:...] or async?
- From: Rick Mann <email@hidden>
- Date: Thu, 20 Jan 2011 14:51:17 -0800
With the advent of code blocks and NSBlockOperation, it's a lot tidier, and easier, to write code using NSURLConnection, particularly in the presence of multiple operations. The approach is to use an NSBlockOperation and +[NSURLConnection
sendSynchronousRequest:returningResponse:error:] to synchronously request a resource (which occurs on a separate thread).
The alternative is to use the asynchronous methods, and then manage all the state necessary to keep track of multiple instances of the same request. I prefer the former approach, but does Apple still recommend the async approach? Or is there no real difference between the two?
I'm running on iOS 4.x, on a single-core device, but I don't think these devices will remain single-core for long, and the same question applies to multicore Macs.
Thanks,
Rick
_______________________________________________
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