Re: (NSURLDownload)The control never reaches downloadDidFinish:
Re: (NSURLDownload)The control never reaches downloadDidFinish:
- Subject: Re: (NSURLDownload)The control never reaches downloadDidFinish:
- From: deepak gopal <email@hidden>
- Date: Fri, 28 Sep 2007 19:25:01 +0100 (BST)
Hi
My app gets into downloadDidFinish only if I run it in
Debug mode.
Even then it seems to be waiting for something. It
waits for about a second or two to print the logs in
downloadDidFinish when in Debug.
But if I run the app in release, it just crashes when
downloadDidFinish is called.
Yes I even have downlod:didFailWithError but its not
even reaching this.
What may be going wrong?
Deepak
PS: the code is the same as below
> code:
> -----------------------------------------------
> NSURLRequest *request;
> request= [NSURLRequest requestWithURL:[NSURL
URLWithString:breakPath]
cachePolicy:NSURLRequestReloadIgnoringCacheData
timeoutInterval:60.0];
>
> NSURLDownload *download = [[NSURLDownload alloc]
> initWithRequest:request delegate:self];
>
> [download autorelease];
>
> // assigning the complete path to the destination
>
> NSString *destination = [garage_
stringByAppendingString:kNewBreakPath];
>
>
> if (download) {
> // This will go and download
> [download setDestination:destination
allowOverwrite:YES];
>
> }
>
> ------------------------------
>
> - (void)downloadDidFinish:(NSURLDownload *)download
> {
> NSString *presentDestination = [garage_
stringByAppendingString:kNewBreakPath];
>
> NSString *finalDestination =
> [[garage_ stringByAppendingString:kNewBreakPath]
stringByAppendingPathExtension:[breakPath
pathExtension]];
>
>
> NSFileManager *fileManager = [NSFileManager
defaultManager];
>
> [fileManager movePath:presentDestination
toPath:finalDestination handler:nil];
>
>
> // this will unarchive the zipped/dmg file
downloaded.
> [self unarchiveDownloadedFile:finalDestination];
>
> }
--- Nick Zitzmann <email@hidden> wrote:
>
> On Sep 27, 2007, at 5:18 PM, deepak gopal wrote:
>
> > I am downloading a file from the server.
> > Its a zip file and I need to uarchive it.
> > I have the code in place (copied below) and I
> > unarchive the file in downloadDidFinish:
> > But the control doesn't seem to reach
> > downloadDidFinish:
> > There is no syntax error.
> >
> > What should I do?
>
> Are you sure the download didn't fail?
> -downloadDidFinish: doesn't
> get called if the download failed for some reason.
>
> Nick Zitzmann
> <http://www.chronosnet.com/>
>
> _______________________________________________
>
> 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
>
Travelling to a new city? Search for ATMs in that city. Go to http://in.maps.yahoo.com
_______________________________________________
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