Re: [問題] Master-Detail的table移動highlight
看來你已經解決問題了
不過建議一下用delegate 不要直接呼叫MasterViewController
理論上Detail不需要也不應該知道Master的實作細節
這樣之後要reuse Detail也比較方便
@property (weak, nonatomic) id <DetailViewControllerDelegate> delegate;
@protocol DetailViewControllerDelegate <NSObject>
- (void)detailViewController:(DetailViewController*)controller didSelectRowAtIndexPath:(NSIndexPath*)indexPath;
@end
: 我在 "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: 199.2.242.199
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):