Objective-C asynchronous callback from

I am trying to create a class that handles some NSURLConnection and authentication elements and then makes a callback for the download. Ends when it has completed the didReceiveData event. How exactly does this work in Objective-C? Thank you!

#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
{
...
}

      

+1


a source to share


1 answer


Here's a good example of this in the Using NSURLConnection section of the URL Loading Guide.



+4


a source







All Articles