-2
調用方法,在目標C我不知道什麼是錯的這個方法調用,它不斷給我的編譯錯誤與「預期的表達」不能迅速
我的方法就像
class func getAllListings(deviceId:String , pageNo:Int ,onSuccess: (ItemsResponse) -> Void, onFail:() -> Void){}
調用方法
[KhawaterServerManager getAllListings: uniqueIdentifier:^(NSString*) pageNo:^(NSInteger*) onSuccess:^(ItemsResponse * _Nonnull items) {
printf("success");
} onFail:^{
printf("fail");
}];
什麼是我的方法調用的問題?
目前還不清楚你想要做什麼。什麼是你想要調用的Objective-C方法?你做了這個嘗試的代碼在哪裏? – nhgrif
@nhgrif我在swift文件中有一個方法是在第一行(deviceId,pageNo)和回調方法中聲明的,我試圖從目標c文件調用它,xcode給我編譯錯誤「Expected Expression」,我不知道我的參數有什麼問題? –
'[KhawaterServerManager getAllListings:uniqueIdentifier:^(NSString *)pageNo:^(NSInteger *)onSuccess:^(ItemsResponse * _Nonnull items)'這不是Objective-C。這基本上是垃圾。 – matt