• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSBlockOperation with +[sendSynchronousRequest sendSynchronousRequest:...] or async?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSBlockOperation with +[sendSynchronousRequest sendSynchronousRequest:...] or async?
      • From: Ken Ferry <email@hidden>
    • Re: NSBlockOperation with +[sendSynchronousRequest sendSynchronousRequest:...] or async?
      • From: Keith Duncan <email@hidden>
    • Re: NSBlockOperation with +[sendSynchronousRequest sendSynchronousRequest:...] or async?
      • From: AurĂ©lien HugelĂ© <email@hidden>
  • Prev by Date: NSTask -launch fails sheepishly when ARG_MAX exceeded
  • Next by Date: Re: best way of making a constant animation
  • Previous by thread: NSTask -launch fails sheepishly when ARG_MAX exceeded
  • Next by thread: Re: NSBlockOperation with +[sendSynchronousRequest sendSynchronousRequest:...] or async?
  • Index(es):
    • Date
    • Thread