• 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: NSURLDownload delegate methods seperate thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLDownload delegate methods seperate thread


  • Subject: Re: NSURLDownload delegate methods seperate thread
  • From: Dave Carrigan <email@hidden>
  • Date: Tue, 8 Sep 2009 14:12:25 -0700


On Sep 8, 2009, at 1:43 PM, Colin Deasy wrote:

Spot on, thanks man.

Fixed it using:
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate distantFuture]];
	while ([self isDownloading] );

This will work, but you won't be able to know if your NSInvocationQueue wants to cancel. If that's important, then this would be better:


while ([self isDownloading] && ![self isCancelled]) {
[[NSRunLook currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.001]];
}


This assumes that your object inherits from NSOperation. You might also want to cancel the NSURLConnection if the operation gets cancelled.

--
Dave Carrigan
email@hidden
Seattle, WA, USA

Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________

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: NSURLDownload delegate methods seperate thread
      • From: "Colin Deasy" <email@hidden>
References: 
 >NSImage with multiple representation sizes (From: Benjamin Rister <email@hidden>)
 >Re: NSImage with multiple representation sizes (From: Ken Ferry <email@hidden>)
 >Re: NSImage with multiple representation sizes (From: Benjamin Rister <email@hidden>)
 >NSURLDownload delegate methods seperate thread (From: Colin Deasy <email@hidden>)
 >Re: NSURLDownload delegate methods seperate thread (From: Randall Meadows <email@hidden>)
 >RE: NSURLDownload delegate methods seperate thread (From: Colin Deasy <email@hidden>)
 >Re: NSURLDownload delegate methods seperate thread (From: Dave Carrigan <email@hidden>)
 >RE: NSURLDownload delegate methods seperate thread (From: Colin Deasy <email@hidden>)

  • Prev by Date: Re: NSURLDownload delegate methods seperate thread
  • Next by Date: Re: [[NSHost currentHost] name] blocking on 10.6 ?
  • Previous by thread: Re: NSURLDownload delegate methods seperate thread
  • Next by thread: RE: NSURLDownload delegate methods seperate thread
  • Index(es):
    • Date
    • Thread