如何從另一個方法訪問動作表單按鈕索引號?我想這些指標數設置爲方法參數如何從另一個方法訪問動作表單按鈕索引號?
0
A
回答
0
使用此delagate - (空)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger的)buttonIndex
你會得到buttonindex在這個委託,你可以調用另一種方法從這裏。
0
你必須委託教學貫徹法的行動表,
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex(NSInteger)buttonIndex
在此您可以檢查buttonIndex即0,1,2 ...和你想在選定的索引。
0
您可以使用該方法
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex(NSInteger)buttonIndex
得到buttonIndex,然後調用從那裏連接到你的Web服務的方法,在buttonIndex作爲參數傳遞。例如:
- (void)methodThatCallsWebservice:(NSInteger)buttonIndex
{
// however you call the webservice goes here
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex(NSInteger)buttonIndex
{
[self methodThatCallWebservice:buttonIndex];
}
相關問題
- 1. 如何從另一個方法訪問變量(按鈕)
- 2. Android Studio。如何訪問OnClick方法中的另一個按鈕?
- 3. 從另一個活動訪問方法
- 4. JavaFX訪問gui按鈕從另一個線程動作
- 5. 如何從另一個活動調用onClick方法的按鈕
- 6. 另一個類中的鏈表可以從一個方法訪問,但不能從另一個方法訪問
- 7. 如何從不同的表單訪問按鈕按鈕? C#
- 8. 如何從c中的另一個窗體訪問按鈕#
- 9. 如何從另一個活動訪問按鈕/活動的視圖
- 10. 如何從另一個片段活動中的片段活動訪問按鈕
- 11. 如何從另一個類訪問一個方法?
- 12. 如何從另一個片段類訪問一個方法?
- 13. 從另一個文件訪問操作按鈕PyQt4
- 14. 從另一個類訪問方法
- 15. 從另一個類訪問方法Android
- 16. 如何從另一種方法調用按鈕單擊事件
- 17. 從一種方法訪問一個到另一個的方法
- 18. 從另一個表單訪問屬性
- 19. 使用單一索引訪問子表的有效方法
- 20. 如何按鈕動作複製回另一個按鈕
- 21. 如何從一個表單按鈕
- 22. 如何使用按鈕從另一個類調用方法?
- 23. 從類中的按鈕訪問方法?
- 24. 在另一個類中引用一個類按鈕動作
- 25. 如何使動作表按鈕轉到另一個頁面?
- 26. C#訪問類從一個表單按鈕
- 27. Foxpro,如何從菜單按鈕訪問表單?
- 28. 按照編號/索引訪問pictureBox
- 29. Lua&OO,如何從另一種方法訪問方法?
- 30. Javascript:從同一類的另一個方法訪問類方法
我知道buttonIndex保持索引號碼,但我怎麼能通過這個選定的索引到一個Web服務? –