由于我是ObjC的新手,我坚持以下问题:
我有一个函数downloadFile
-(void) downloadFile:(NSMutableArray*)paramArray withDict:(NSMutableDictionary*)options
{
//do stuff
}
Run Code Online (Sandbox Code Playgroud)
我想以线程开头,因此我使用这行代码:
NSThread* dLoad = [[NSThread alloc] initWithTarget:self selector:@selector(downloadFile:) object:nil];
[dLoad start];
Run Code Online (Sandbox Code Playgroud)
它抛出以下错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSThread initWithTarget:selector:object:]: target does not implement selector (*** -[LaunchDownload downloadFile:])'
Run Code Online (Sandbox Code Playgroud)
我在这里错过了什么?
objective-c ×1