-3
我剛開始在iOS和我試圖讓用戶自定義函數...如何在Objective-C中調用方法?
我的代碼:
-(void) testFunction{
//has self. calls
}
-(IBAction)button:(id)sender {
testFunction();
}
我得到警告:函數隱式聲明是無效的C99
我在做什麼錯?或者我有什麼要添加到我的代碼?
我剛開始在iOS和我試圖讓用戶自定義函數...如何在Objective-C中調用方法?
我的代碼:
-(void) testFunction{
//has self. calls
}
-(IBAction)button:(id)sender {
testFunction();
}
我得到警告:函數隱式聲明是無效的C99
我在做什麼錯?或者我有什麼要添加到我的代碼?
在Objective-C中,你不能寫testFunction()
。你發送'消息',你可以通過這樣做
[self testFunction]
非常感謝你 – slowsword 2013-03-20 23:35:24