[問題] Master-Detail的table移動highlight

看板MacDev作者 (elver)時間12年前 (2013/01/21 01:15), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
不好意思問一下 版上前輩們. 已解決~~~ ^o^ 我用xcode開Master-Detail範例(iPad的版本) 在Detail的頁面做了2顆按鈕,分別是上和下, 假設Master的Table那邊已經很多列可以選了。 想要達到"在Detail這邊按那兩顆按鈕,來控制Master(Table)那邊的光棒移動" 類似DropBox iPad版本那樣~ 以我現在所知道的觀念,要動UI要是當前的主頁面, 難道要PUSH資料回去Master,動完光棒後,在PUSH回Detail嗎? 下面是我的用法,可是按按鈕還是沒有反應~! 我在 "DetailViewController.h" 追加這兩行 @class MasterViewController; @property (strong, nonatomic) MasterViewController *masterViewController; 我在 "DetailViewController.m" 追加 #import "MasterViewController.h" int select; ///設全域變數 - (IBAction)downBtn:(id)sender { select=select+1; NSLog(@"down-select=%d",select); ///check 數值 NSIndexPath *indexPathBlue; indexPathBlue = [NSIndexPath indexPathForRow:select inSection:0]; [self.masterViewController.tableView selectRowAtIndexPath:indexPathBlue animated:YES scrollPosition:UITableViewScrollPositionMiddle]; } 想說為啥光棒會消失~~(卡超久 原來-1忘了改+1 -_-||a -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.135.166.170 ※ 編輯: elver 來自: 220.135.166.170 (01/22 07:06)
文章代碼(AID): #1G_2OQFd (MacDev)
文章代碼(AID): #1G_2OQFd (MacDev)