我想使用 Restkit 异步下载文件。但是,当使用 sendAsynchronously 方法时应用程序崩溃。如果我使用 sendSynchronously 而不是 sendAsynchronously,它不会崩溃。有没有人知道为什么?
这是我的代码
NSString *passURL = @"https://s3.amazonaws.com/mheydt-mhtnd/2012-03-13-1.png";
RKRequest *request = [RKRequest requestWithURL:[NSURL URLWithString: passURL]];
request.delegate = self;
[request sendAsynchronously];
- (void)request:(RKRequest *)request didReceiveResponse:(RKResponse *)response {
NSLog(@"didReceiveResponse");
}
- (void)request:(RKRequest *)request didLoadResponse:(RKResponse *)response {
NSLog(@"didLoadResponse");
}
非常感谢!