Note that there are some explanatory texts on larger screens.

plurals
  1. PORefreshing Master TableView of a UISplitView Controller
    primarykey
    data
    text
    <p>while porting our latest iPhone App to an universal app, I decided to use a iPad's SplitView Controller inside of a TabBarController. The SplitViewController is managed by AppDelegate for every Tab.</p> <p>All works fine, but my problem is that my MasterView (on the left of the SplitView) includes 4 Category-Buttons to change the TableViews Data. If I click one of the buttons, the TableView needs to Refresh/ReloadData, to Display the new Content of the selected category. I created a function to do the changes and linked my buttons to it in the interface builder.</p> <p>At the end of my function, I tried to refresh the Controller like this:</p> <pre><code>[self tableView ReloadData]; </code></pre> <p>but the SplitView don't show the refresh. Still the old Data. I tested around a bit with NSLog, to check if my function works correctly. No problems.</p> <p>Then I tried to access the tableView through SplitViewController itself, like this:</p> <pre><code> // PresetController is my TableViewController in the SplitView UISplitViewController *split = (UISplitViewController *)self.parentViewController; PresetController *detail = [split.viewControllers objectAtIndex:0]; [detail.tableView reloadData]; </code></pre> <p>Again, no error,.. but no refresh.</p> <p>Am I missing something? Is there any way to easily reload the TableViewController in SplitView? I've read something about sending a Notfication via NotificationCenter to the delegate, but still couldn't find a helpful ressource.</p> <p><strong>EDIT:</strong></p> <p>For understanding my structure, here is the way I set up the SplitView in my AppDelegates "didFinishLaunchingWithOptions" Method: </p> <pre><code>NSMutableArray *controllers = [NSMutableArray arrayWithCapacity:[self.rootController.viewControllers count]]; int tabNum = 0; for (UIViewController *controller in self.rootController.viewControllers) { UISplitViewController *split = [[[UISplitViewController alloc] init] autorelease]; split.tabBarItem = controller.tabBarItem; iPadDetailView *detail = [[iPadDetailView alloc] initWithNibName:@"iPadDetailView" bundle:nil]; // a detail view will come here UINavigationController *nav = [[[UINavigationController alloc] initWithRootViewController:detail] autorelease]; split.viewControllers = [NSArray arrayWithObjects:controller, nav, nil]; [controllers addObject:split]; } tabNum++; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload