NSURLDownload를 사용하여 URL을 다운로드하려고하지만 다운로드가 시작되지 않습니다. 계속하기 전에 GNUStep을 사용하고 있다고 말해야합니다. 다음과 같이NSURL 다운로드가 시작되지 않습니다
내 프로젝트의 개요는 다음과 같습니다
에서 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];
}
나는 NSLog의 MyClass에 모두 기능에의 그들 중 어느 쪽이 맞았다. 다운로드를 시작하려면 무엇을해야합니까? 아니면 GNUStep의 문제입니까?
당신은 NSObject가 아닌 Object를 서브 클래 싱 하시겠습니까? 대리모를 콜렉션 또는 뭔가에 넣을 때를 대비해서 NSObject를 사용해야 할 것입니다. (또한, 당신은 정말로 "MyClass"보다 더 나은 이름을 생각해야하고, 메모리 관리 규칙에 따라 객체의 수명을 적절히 관리해야합니다 : http://developer.apple.com/mac/library/documentation/General/Conceptual/DevPedia -CocoaCore/MemoryManagement.html) –