Re: (NSURLDownload)The control never reaches downloadDidFinish: (readable code)

  • The code should be more readable now. The question is
    still the same, I checked through many examples and
    didn't find a way to debug this.

    What's wrong?

    Thank you
    DG

    --- deepak gopal <deengg...> wrote:

    > Hi
    >
    > 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?
    >
    > Thank you
    > DG
    >
    > 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_
    tringByAppendingString: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];
    >
    > }
    >

          Bring your gang together - do your thing. Go to http://in.promos.yahoo.com/groups
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today