我想從updateButtonPressed方法調用另一個方法。 這是我的嘗試。如何從另一個方法調用方法
-(IBAction) updateButtonPressed{
[self loadScrollViewWithPage];
}
但問題是loadScrollViewWithPage方法具有參數。該方法是這樣的
- (void)loadScrollViewWithPage:(int)page {
}
我怎麼能要求這種方法?請給我一個幫助。 感謝先進。
我想從updateButtonPressed方法調用另一個方法。 這是我的嘗試。如何從另一個方法調用方法
-(IBAction) updateButtonPressed{
[self loadScrollViewWithPage];
}
但問題是loadScrollViewWithPage方法具有參數。該方法是這樣的
- (void)loadScrollViewWithPage:(int)page {
}
我怎麼能要求這種方法?請給我一個幫助。 感謝先進。
- (IBAction) updateButtonPressed{
int tempValue=5;
[self loadScrollViewWithPage:tempValue];
}
如果我理解正確,你想知道如何將消息傳遞給對象,是嗎?嘗試:
-(IBAction) updateButtonPressed{
int foo = 4;
[self loadScrollViewWithPage:foo]; // a colon, followed by the argument
}
雖然我建議您閱讀一般的Objective-C語言。
感謝很多人,它解決了:) – sajaz