我有兩個導航按鈕(左和右)和兩個類別按鈕(例如loveCategory和otherCategory)。當我選擇loveCategory時,我希望我的導航按鈕僅在loveCategory中顯示(在我的情況下爲Images),當我按otherCategory時,導航按鈕應該只能從otherCategory顯示(圖像)(即當我按左右按鈕)。UIButton做不同的動作ios
讓我知道如果這不明確。
這裏是我的代碼:
-(IBAction)NavigationBtnTapped:(UIButton*)sender {
UIButton *button=sender;
switch (button.tag) {
case 1:
//statements
break;
case 2:
//statements
break;
default:
break;
}
}
-(IBAction)loveCategory {
}
-(IBAction)otherCategory {
}
我如何調用一個動作與另一動作中
-(IBAction)loveCategory
{
-(IBAction)NavigationBtnTapped:(id)sender
{
// Is it possible to call an action within another action?
}
}
@chirag - 拼寫錯誤?大聲笑 – Vikr 2013-03-21 12:47:25
我沒有得到你完全請解釋更多。你是什麼意思'只從loveCategory'和'只從otherCategory'。你想爲不同類別的不同導航按鈕嗎? – 2013-03-21 12:47:33
仍然接受:) – 2013-03-21 12:48:16