Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/111.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.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
Ios 无法在performSelectorInBackground内调用实例方法_Ios_Iphone_Objective C - Fatal编程技术网

Ios 无法在performSelectorInBackground内调用实例方法

Ios 无法在performSelectorInBackground内调用实例方法,ios,iphone,objective-c,Ios,Iphone,Objective C,我有一个类MatchDayDataController,它有一个方法PushCompleteDataToServer 我想从另一个类SummaryVC.m调用performSelectorInBackground中的PushIncompletedDataToServer 代码: 它显示了performSelectorInBackground中的一些语法错误。我错过了什么?请引导。试试这个 [sharedDataController performSelectorInBackground:@sel

我有一个类MatchDayDataController,它有一个方法PushCompleteDataToServer

我想从另一个类SummaryVC.m调用performSelectorInBackground中的PushIncompletedDataToServer

代码:

它显示了performSelectorInBackground中的一些语法错误。我错过了什么?请引导。

试试这个

[sharedDataController performSelectorInBackground:@selector(pushIncompleteDataToServer) withObject:nil];
而不是

[self performSelectorInBackground:@selector([sharedDataController pushIncompleteDataToServer]) withObject:nil];
试试这个

[sharedDataController performSelectorInBackground:@selector(pushIncompleteDataToServer) withObject:nil];
而不是

[self performSelectorInBackground:@selector([sharedDataController pushIncompleteDataToServer]) withObject:nil];
试试这个

[sharedDataController performSelectorInBackground:@selector(pushIncompleteDataToServer) withObject:nil];
而不是

[self performSelectorInBackground:@selector([sharedDataController pushIncompleteDataToServer]) withObject:nil];
试试这个

[sharedDataController performSelectorInBackground:@selector(pushIncompleteDataToServer) withObject:nil];
而不是

[self performSelectorInBackground:@selector([sharedDataController pushIncompleteDataToServer]) withObject:nil];

您需要将
self
替换为
sharedDataController

[sharedDataController performSelectorInBackground:@selector(pushIncompleteDataToServer) withObject:nil];

选择器将在
performSelectorInBackground
消息的接收器上执行,而
self
不实现该方法。

您需要将
self
替换为
sharedDataController

[sharedDataController performSelectorInBackground:@selector(pushIncompleteDataToServer) withObject:nil];
[self performSelectorInBackground:@selector([sharedDataController pushIncompleteDataToServer]) withObject:nil];

选择器将在
performSelectorInBackground
消息的接收器上执行,而
self
不实现该方法。

您需要将
self
替换为
sharedDataController

[sharedDataController performSelectorInBackground:@selector(pushIncompleteDataToServer) withObject:nil];
[self performSelectorInBackground:@selector([sharedDataController pushIncompleteDataToServer]) withObject:nil];

选择器将在
performSelectorInBackground
消息的接收器上执行,而
self
不实现该方法。

您需要将
self
替换为
sharedDataController

[sharedDataController performSelectorInBackground:@selector(pushIncompleteDataToServer) withObject:nil];
[self performSelectorInBackground:@selector([sharedDataController pushIncompleteDataToServer]) withObject:nil];
选择器将在
performSelectorInBackground
消息的接收器上执行,而
self
不执行该方法

[self performSelectorInBackground:@selector([sharedDataController pushIncompleteDataToServer]) withObject:nil];
这将使代码在同一类中搜索该方法

应该是:

[sharedDataController performSelectorInBackground:@selector(pushIncompleteDataToServer) withObject:nil];
它将调用
sharedDataController
类中的方法

此外,在方法
performSelectorInBackground:withObject:
中,withObject用于传递给选择器方法的参数。在这种情况下,由于没有参数,我们传递nil

这将使代码在同一类中搜索该方法

应该是:

[sharedDataController performSelectorInBackground:@selector(pushIncompleteDataToServer) withObject:nil];
它将调用
sharedDataController
类中的方法

此外,在方法
performSelectorInBackground:withObject:
中,withObject用于传递给选择器方法的参数。在这种情况下,由于没有参数,我们传递nil

这将使代码在同一类中搜索该方法

应该是:

[sharedDataController performSelectorInBackground:@selector(pushIncompleteDataToServer) withObject:nil];
它将调用
sharedDataController
类中的方法

此外,在方法
performSelectorInBackground:withObject:
中,withObject用于传递给选择器方法的参数。在这种情况下,由于没有参数,我们传递nil

这将使代码在同一类中搜索该方法

应该是:

[sharedDataController performSelectorInBackground:@selector(pushIncompleteDataToServer) withObject:nil];
它将调用
sharedDataController
类中的方法


此外,在方法
performSelectorInBackground:withObject:
中,withObject用于传递给选择器方法的参数。在这种情况下,由于没有参数,我们传递nil。

尝试
[sharedDataController PerformSelector Background:@selector(PushUncompleteDataToServer),对象为nil]尝试
[sharedDataController执行选择器背景:@selector(PushUncompleteDataToServer),对象:nil]尝试
[sharedDataController执行选择器背景:@selector(PushUncompleteDataToServer),对象:nil]尝试
[sharedDataController执行选择器背景:@selector(PushUncompleteDataToServer),对象:nil]