UISplitViewController reload data
How can I call function from UISplitViewController subclass to other ViewController.
I have an application that displays splitview and shows modal popup after. When popup is closed, I need to reload data. So appdelegate looks like 开发者_StackOverflow社区this:
[self.window addSubview:splitview.view];
[splitview presentModalViewController:popup_ctrl animated:YES];
On TableViewController I've made funcion reloadData;
I found out that by subclassing UISplitViewController, I can detect closing of popup with -(void)viewDidAppear:(BOOL)animated. I've tried following code:
[[self.viewControllers objectAtIndex:0] reloadData];
However it crashes with NSInvalidArgumentException: unrecognized selector.
What do I have to modify to make the function reloadData work?
Why not explicitly add a property to your SplitViewController that references your TableViewController?
Then you can say
mySplitViewController.TableViewController = myTableViewController;
and later call
[mySplitViewController.TableViewController reloadData];
精彩评论