• 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: Service with NSURLConnection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Service with NSURLConnection


  • Subject: Re: Service with NSURLConnection
  • From: Uli Kusterer <email@hidden>
  • Date: Sat, 12 Jan 2013 05:31:12 +0100

On 11.01.2013, at 20:45, Jens Alfke <email@hidden> wrote:
> Then you’ll need to block the main thread until the background thread finishes its work. You could use an NSConditionLock to do that — main thread creates the lock and locks it, passes the lock to the background thread, then blocks waiting for the condition to change. The background thread sets the condition when it finishes its work.

 If for some reason this doesn't work, you could also try running an NSRunLoop in the main thread that checks for your second thread being finished. Haven't tried that, but it would keep the main thread from returning until you actually have data.

 Of course, in any way, both approaches would probably cause the app from which your service was invoked to beachball until you return.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://groups.yahoo.com/group/mac-gui-dev/




_______________________________________________

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: 
 >Service with NSURLConnection (From: Jim Thomason <email@hidden>)
 >Re: Service with NSURLConnection (From: Jens Alfke <email@hidden>)
 >Re: Service with NSURLConnection (From: Jim Thomason <email@hidden>)
 >Re: Service with NSURLConnection (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: How to force creation of default persistentStore/autosave in NSPersistentDocument
  • Next by Date: Re: Cococa-Dev : was [coredata count not fulfill fault after object delete]
  • Previous by thread: Re: Service with NSURLConnection
  • Next by thread: Tracking object references
  • Index(es):
    • Date
    • Thread