tags:

views:

129

answers:

1

i have coded in applicationdidfinishing method in appdelegate.m file.RtbfViewController,infoViewController are UItableviewcontrolleras.but when i click HOME tab,it does not show table.what i have to do? anyone can help?

tabBarController = [[UITabBarController alloc] init];
RtbfViewController *rtbfViewController = [[RtbfViewController alloc]    
                                          initWithStyle:UITableViewStyleGrouped];
rtbfViewController.tabBarItem.title = @"HOME";
InfoViewController *infoViewController = [[InfoViewController alloc] 
                                          initWithStyle:UITableViewStyleGrouped];
infoViewController.tabBarItem.title = @"INFO";
tabBarController.viewControllers = [NSArray arrayWithObjects:
                                    rtbfViewController,infoViewController,nil];
tabBarController.customizableViewControllers = [NSArray arrayWithObjects:nil];

[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
+1  A: 

If you haven't put any data in the tables yet, you won't get much indication of the tables being present. It's hard to tell if this is your problem or not without seeing the code for your subclasses RtbfViewController and InfoViewController.

Just in case this is your problem: You can add data to your tables by implementing the UITableViewDataSource protocol, and from there implementing at least the two required methods:

  • – tableView:cellForRowAtIndexPath:
  • – tableView:numberOfRowsInSection:

and this methods is used for grouped tables:

  • – numberOfSectionsInTableView:

Also, don't forget to set the dataSource instance variable of your UITableView if needed.

In general, the TableViewSuite is a useful code example from Apple for learning about the UITableView related classes.

Tyler
thank you very much