• 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
Re: NSURLConnection Threading Behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLConnection Threading Behavior


  • Subject: Re: NSURLConnection Threading Behavior
  • From: Chris Suter <email@hidden>
  • Date: Tue, 3 Jul 2007 11:05:03 +1000


On 03/07/2007, at 10:55 AM, Carter R. Harrison wrote:

This might be a silly question, but here goes anyway.
When you call either of the following messages

initWithRequest:delegate:

and

connectionWithRequest:delegate:

on a NSURLConnection, it is my understanding that the methods return a NSURLConnection, which performs the actual request in a background thread. When the request is completed, the NSURLConnection's delegate connectionDidFinishLoading: method. Does this delegate method also run in this same background thread? My guess is that this should be the case.

I know for certain that some delegate methods called by NSURLConnection run in a different thread to the one you kick things off in. I can't remember which ones though. It should be easy for you to figure it out.


Note also that NSURLConnection needs the run loop to be in a certain mode for it to work. For example, the modal run loop mode won't work with NSURLConnection (which means you can't easily put a WebView in a modal dialog). I don't know if Apple have fixed this or are going to fix it.

- Chris

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

References: 
 >NSURLConnection Threading Behavior (From: "Carter R. Harrison" <email@hidden>)

  • Prev by Date: Re: NSPopupButton in main window changes when NSUserDefaultsController adds/removes item in Preference Pane
  • Next by Date: Re: NSPopupButton in main window changes when NSUserDefaultsController adds/removes item in Preference Pane
  • Previous by thread: NSURLConnection Threading Behavior
  • Next by thread: Re: Two NSRects adjacent/touching?
  • Index(es):
    • Date
    • Thread