• 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: how to wait the finish of NSURLDownload
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to wait the finish of NSURLDownload


  • Subject: Re: how to wait the finish of NSURLDownload
  • From: Michael Vannorsdel <email@hidden>
  • Date: Thu, 17 Apr 2008 00:26:44 -0600

Instead of calling stop:, try CFRunLoopStop(CFRunLoopGetCurrent()). Should stop the innermost runloop call.



On Apr 17, 2008, at 12:16 AM, xiaobin wrote:

In my application, I want to download a file from internet. so I use
NSURLDownload to do it. and using NSRunLoop to wait until finish the
downloading action. for example 2 seconds. codes as the following

[downloadFile setDestination:downloadPath allowOverwrite:YES];

[[NSRunLoop currentRunLoop] runUntilDate:[NSDate
dateWithTimeIntervalSinceNow: 2 ]];

it works correctly.
But I think it is too long time for the users who will use my
application. and I can change 2 seconds to 0.5 seconds, but how to do
if my server file is too large to download in 0.5 seconds.

and if I use

[[NSRunLoop currentRunLoop] run];

and use NSURLDownload delegate method, the following, to stop the
loop, it can not work well.

- (void)downloadDidFinish:(NSURLDownload *)download
{
	//....
	NSApplication *app = [NSApplication sharedApplication];
	[app stop:self];
}
using the stop method, It looks like to stop my whole application.

_______________________________________________

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: 
 >how to wait the finish of NSURLDownload (From: xiaobin <email@hidden>)

  • Prev by Date: how to wait the finish of NSURLDownload
  • Next by Date: Re: 1-bit NSBitmapImageRep?
  • Previous by thread: how to wait the finish of NSURLDownload
  • Next by thread: Re: how to wait the finish of NSURLDownload
  • Index(es):
    • Date
    • Thread