RE: NSURLDownload delegate methods seperate thread

2009-09-09 Thread Colin Deasy
NSURLDownload delegate methods seperate thread > Date: Wed, 9 Sep 2009 09:57:45 -0700 > > > On Sep 9, 2009, at 8:35 AM, Colin Deasy wrote: > > > Ok so I have tried both ways, using the main thread for the download > > messages and using NSOperationQueue to create separate th

Re: NSURLDownload delegate methods seperate thread

2009-09-09 Thread Jens Alfke
On Sep 9, 2009, at 8:35 AM, Colin Deasy wrote: Ok so I have tried both ways, using the main thread for the download messages and using NSOperationQueue to create separate threads & run loops. I'm still getting 30% CPU though. When I run it, my app seems to send the kernel_task a bit crazy

RE: NSURLDownload delegate methods seperate thread

2009-09-09 Thread Colin Deasy
From: Dave Carrigan [mailto:d...@rudedog.org] Sent: 08 September 2009 22:12 To: Colin Deasy Cc: cocoa-...@not-pc.com; cocoa-dev@lists.apple.com Subject: Re: NSURLDownload delegate methods seperate thread On Sep 8, 2009, at 1:43 PM, Colin Deasy wrote: > Spot on, thanks man. > > F

Re: NSURLDownload delegate methods seperate thread

2009-09-08 Thread Dave Carrigan
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 im

Re: NSURLDownload delegate methods seperate thread

2009-09-08 Thread Kyle Sluder
On Tue, Sep 8, 2009 at 1:43 PM, Colin Deasy wrote: > So just blocks until finished the download. If I take away the while loop it > doesn't run.Is there a better way? Then why are you running in a separate thread at all? Why not just run asynchronously on the main thread? --Kyle Sluder

RE: NSURLDownload delegate methods seperate thread

2009-09-08 Thread Colin Deasy
m; cocoa-dev@lists.apple.com > From: d...@rudedog.org > To: colde...@hotmail.com > Subject: Re: NSURLDownload delegate methods seperate thread > Date: Tue, 8 Sep 2009 12:55:33 -0700 > > > On Sep 8, 2009, at 12:36 PM, Colin Deasy wrote: > > > Well I did try that

Re: NSURLDownload delegate methods seperate thread

2009-09-08 Thread Dave Carrigan
On Sep 8, 2009, at 12:36 PM, Colin Deasy wrote: Well I did try that but there were no callbacks. That is I initiated the download in the start method of an NSOperation. You likely have no run loop running on the thread. You need that for NSURLConnection to do its work. -- Dave Carrigan

RE: NSURLDownload delegate methods seperate thread

2009-09-08 Thread Colin Deasy
Well I did try that but there were no callbacks. That is I initiated the download in the start method of an NSOperation. > Subject: Re: NSURLDownload delegate methods seperate thread > From: cocoa-...@not-pc.com > Date: Tue, 8 Sep 2009 13:17:55 -0600 > CC: cocoa-dev@lists.apple.com

Re: NSURLDownload delegate methods seperate thread

2009-09-08 Thread Randall Meadows
On Sep 8, 2009, at 1:03 PM, Colin Deasy wrote: Hey, Is anyone aware of a way to receive NSURLDownload's delegate methods on a separate thread, i.e. not the main one? "Delegate messages will be sent on the thread which calls this method." So, start your NSURLDownload on whichever thread you

NSURLDownload delegate methods seperate thread

2009-09-08 Thread Colin Deasy
Hey, Is anyone aware of a way to receive NSURLDownload's delegate methods on a separate thread, i.e. not the main one? I am using an NSOperationQueue to manage them but at the moment I need to use the performSelectorOnMainThread method to get it too work. The problem with this is that it drives