Question

I am using BlackRaccoon to download a file from FTP server. Following is the code:

- (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];  
}

Its gives following error

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'

Any help will be appreciated.

Was it helpful?

Solution

requestFailed: is one of the BRRequest delegate method that you must implement in your view controller.

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

I'm not sure how your code even compiled. This is a required method of the protocol.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top