Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 安装中的线程错误?_Objective C - Fatal编程技术网

Objective c 安装中的线程错误?

Objective c 安装中的线程错误?,objective-c,Objective C,我收到一条错误信息: Automatic Reference Counting Issue Receiver type 'NSThread' for instance message does not declare a method with selector 'initWithTarget:selector:Object:' 对于此代码: NSThread *thread_Client = [[NSThread alloc] initWithTarget:self selector:@se

我收到一条错误信息:

Automatic Reference Counting Issue
Receiver type 'NSThread' for instance message does not declare a method with selector 'initWithTarget:selector:Object:'
对于此代码:

NSThread *thread_Client = [[NSThread alloc] initWithTarget:self selector:@selector(myTcpClient:) Object:nil];
为什么。。。我错过了什么


thx

错误消息实际上告诉您这里缺少什么。它说NSThread没有这样的选择器,这意味着您应该查看方法签名,因为您的问题几乎肯定存在,在您的情况下,它确实存在

代码中的错误是选择器中的单词对象。方法签名不使用大写字母O。将其更改为小写即可:

// Method signatures are case sensitive, so:
// -initWithTarget:selector:Object: and -initWithTarget:selector:object are different methods
[[NSThread alloc] initWithTarget:self selector:@selector(myTcpClient:) object:nil];