Objective-c using stream reasons: target does not implement a selector

Since I'm fairly new to ObjC, I stick to the following problem:

I have a downloadFile function

-(void) downloadFile:(NSMutableArray*)paramArray withDict:(NSMutableDictionary*)options      
{
    //do stuff
}

I want to run this as a stream, and so I use this line of code:

NSThread* dLoad = [[NSThread alloc] initWithTarget:self selector:@selector(downloadFile:) object:nil];
[dLoad start];  

It gives me the following error:

 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSThread initWithTarget:selector:object:]: target does not implement selector (*** -[LaunchDownload downloadFile:])'

What am I missing here?

+5
source share
2 answers

I believe that you are not providing enough arguments for your flow. The method you entered has a signature downloadFile:withDict:, but you provide downloadFile:. You must specify a valid selector name.

, - NSThread , , , , NSDictionary, , .

+9

downloadFile:withDict:, downloadFile:.

+3

All Articles