Hi all, Im still a newbie at this so I hope my question make sense.
I have a class that is a UITableViewController.
The app has a TabBar, and the item has a navigation controller, which has a view that is of my "OptionsRootController"
So There is no code that loads the "optionsRootContoller", because if there was I would just initWithStyle:UITableViewStyleGrouped, and be done.
So My Questions is how to I from within my OptionsRootController tell it to create the tableView with sections?
I assume that I have to do this in the ViewWillAppear but everything I tried didnt work so I'm asking if anyone knows how to initWithStyle when the class is being loaded from Interface builder....
honestly I'm thinking of going and dumping the Nibs and IB, i have spent more time debugging IB links than actual code..
Thanks for the code but I tried it and I don't think my first question was accurate..
So take a look at this Nib structure
So the OptionsRootContoller, is the UITableView that I want to always initWithStyle:UITableViewStyleGrouped
But I dont think when its being loaded via the Main nib which has the tab bar, that its calling initWithStyle. I placed logging in this method and nothing is loged.
How do you force a UITableView to be StyleGrouped when its loaded from a Nib?
I really hate haveing to ask again but I think the problem is that there is a navigation bar in the mix.
here is my nib after doing your suggestion and it appears to be exactly as you reccomended but still no go.
Every looks as it should on left but at run time, its still not grouped.
The problem is My NavController/optionsViewController wasnt linked to the optionsViewController for the datasource and the deleteage, once it did that, it was exactly what I wanted.
Thanks for your help.
I'm having the same issue. The opening UITableViewController in my UINavigationController app is "RootViewController" and I want it to launch with a grouped table. I'm not using IB; I'm doing everything programmatically. I tried pasting this code into RootViewController.m to override the initWithStyle method but it still launches with a plain table. I put a breakpoint in the method and ran the debugger and it never gets called. Any further thoughts?
I love it when people bump old threads, especially ones in which the question has been answered, and provide a wrong answer. Bonus points for making a new account in order to do this.
Either,
1. The property is empty, which means the init doesn't do anything, or
2. This re-initializes an object that has already been initialized, which you shouldn't do.