i want to send a message to a tableView in another controller.
Actually i am in detalViewController.
The tableView i want to address is in DashboardViewController:
-UIViewController
–UIView
—UITableView //i want to address this tableView.
How can i do that?
In my DetailViewController IBAction i have this code:
NSLog(@"previousBtn");
DashboardViewController *parent = (DashboardViewController *)self.parentViewController;
NSIndexPath *actualIndexPath = selectedRow2;
NSIndexPath * newIndexPath = [NSIndexPath indexPathForRow:actualIndexPath.row-1 inSection:actualIndexPath.section];
My aim is to set the new selectRowAtIndexPath:
[parent.tableViews selectRowAtIndexPath:newIndexPath animated:YES scrollPosition:UITableViewScrollPositionMiddle];
but parent.tableViews is not the correct way
Thanks for help,
brush51
Here is a workaround:
iam checking the subviews array and from NSLog i see the tablview was objectAtIndex:0. Then i have put that in an “if then else” and do something with the table.
In my case i do selectRowAtIndexPath: and didSelectRowAtIndexPath:
Hope someone can use this code and save a lot of time for try and error 🙂