views:

197

answers:

1

Hi all,

I'm trying to make a class that handles some NSURLConnection and authentication stuff and then makes a callback to downloadFinished when it has completed the didReceiveData event. How exactly does that work in Objective-C? Thanks!

#import "fetch.h"

...

- (IBAction)downloadButton {
    fetch *downloader = [[fetch alloc] init];

    [downloader setAuth:Username.text password:Password.text saveName:@"test.txt"];
    [downloader download:@"http://google.com"];
}

-(void)downloadFinished:(NSString *)fileName
{
...
}
+4  A: 

There's a good example of this in the Using NSURLConnection section of the URL Loading System guide.

Rob Napier