Always use the async API.
For networking, there are *tons* of reasons to avoid your own threading (ie, 
CPU -> battery consumption) when Apple does all that for your using their Async 
API (and only one global thread to manage the network)
Look at the free WWDC videos from 2010, this is very well explained.


Aurélien,
Objective Decision Team




On 20 janv. 2011, at 23:51, Rick Mann wrote:

> 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 (Cocoa-dev@lists.apple.com)
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/hugele.aurelien%40objective-decision.com
> 
> This email sent to hugele.aurel...@objective-decision.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to