(NSURLDownload)The control never reaches downloadDidFinish:
(NSURLDownload)The control never reaches downloadDidFinish:
- Subject: (NSURLDownload)The control never reaches downloadDidFinish:
- From: deepak gopal <email@hidden>
- Date: Fri, 28 Sep 2007 00:18:11 +0100 (BST)
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_
stringByAppendingString:kNewBreakPath];
if (download) {
// This will go and download
[download setDestination:destination
allowOverwrite:YES];
}
------------------------------
- (void)downloadDidFinish:(NSURLDownload *)download {
NSString *breakPath = [framePath_ stringValue];
breakPath = [breakPath
stringByTrimmingCharactersInSet:
[NSCharacterSet
whitespaceAndNewlineCharacterSet]];
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];
}
Why delete messages? Unlimited storage is just a click away. Go to http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html
_______________________________________________
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