0

我正在使用 BlackRaccoon 从 FTP 服务器下载文件。以下是代码:

- (IBAction)download:(id)sender {


    downloadData = [NSMutableData dataWithCapacity: 1];

    downloadFile = [[BRRequestDownload alloc] initWithDelegate: self];

    downloadFile.path = @"psnewsletter.pdf";
    downloadFile.hostname = @"server";
    downloadFile.username = @"user";
    downloadFile.password = @"pswd";

    [downloadFile start];  
}

它给出以下错误

2014-02-20 11:48:43.526 BlackHillPrimarySchool[2036:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MainViewController requestFailed:]: unrecognized selector sent to instance 0xcd609f0'

任何帮助将不胜感激。

4

1 回答 1

1

requestFailed:BRRequest您必须在视图控制器中实现的委托方法之一。

- (void)requestFailed:(BRRequest *)request {
    BRRequestError *reqError = request.error;
    // check the error, handle as needed.
}

我不确定你的代码是如何编译的。这是协议的必需方法。

于 2014-02-20T01:19:13.377 回答