I am attempting to download a URL using NSURLDownload, but it does not start downloading. Before continuing it must be said that I am using GNUStep for this.
The outline of my project is as follows:
MyClass.h:
@interface MyClass : Object {
}
-(void)downloadDidBegin:(NSURLDownload*)download;
-(void)downloadDidFinish:(NSURLDownload*)download;
@end
Main.m
int main()
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSLog(@"creating url");
NSURL* url = [[[NSURL alloc] initWithString:@"http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSURLRequest_Class/NSURLRequest_Class.pdf"] autorelease];
NSLog(@"creating url request");
NSURLRequest* url_request = [[[NSURLRequest alloc] initWithURL:url] autorelease];
NSLog(@"creating MyClass instance");
MyClass* my_class = [[MyClass alloc] init];
NSLog(@"creating url download");
NSURLDownload* url_download = [[[NSURLDownload alloc] initWithRequest:url_request
delegate:my_class] autorelease];
[pool drain];
}
I have NSLog's on both functions in MyClass and neither of them is hit. What do I have to do to get the download started? Or is this an issue with GNUStep?