我正在使用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'


任何帮助将不胜感激。

最佳答案

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

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


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

关于ios - BlackRaccoon下载文件时出现错误:无法识别的选择器已发送到实例0xcd609f0,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21895930/

10-10 23:32