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