作者ksksBangBang (Bang!)
看板MacDev
标题Re: [问题] Master-Detail的table移动highlight
时间Sat Feb 2 01:42:40 2013
看来你已经解决问题了
不过建议一下用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