別のコントローラのtableViewにメッセージを送信したい。 実際には私はdetalViewControllerにいます。 私が対処したいのtableViewがDashboardViewControllerである:
--UIView
他のコントローラからviewController階層を歩く
-UIViewController --- のUITableView//私はこののtableViewに対処したいと思います。
どうすればいいですか?私DetailViewController IBActionで 私はこのコードを持っている:
NSLog(@"previousBtn");
DashboardViewController *parent = (DashboardViewController *)self.parentViewController;
NSIndexPath *actualIndexPath = selectedRow2;
NSIndexPath * newIndexPath = [NSIndexPath indexPathForRow:actualIndexPath.row-1 inSection:actualIndexPath.section];
私の目的は、新しいselectRowAtIndexPath設定することです:
[parent.tableViews selectRowAtIndexPath:newIndexPath animated:YES scrollPosition:UITableViewScrollPositionMiddle];
をしかしparent.tableViewsは助けを おかげで、
brush51正しい方法ではありません