views:

46

answers:

1

I've created an iPad application with a UITableViewController in the UISplitViewController (and everything works :) Since I'd like the table to use UITableViewStyleGrouped, i added:

- (id)init
{
    self = [super initWithStyle:UITableViewStyleGrouped];
    if (self != nil) {
        // Initialisation code
    }
    return self;
}

to the root view controller & included it in the .h, but it's never getting called. So, two questions, can I set UITableViewStyleGrouped for a table in a UISplitViewController? And, if so, how?

+3  A: 

init won't be called, initWithStyle: or initWithFrame:style: might be called.

vakio
Nope... neither of them are called.
tg2
Even if I explicitly call it in the app delegate, it doesn't get called.
tg2
How/When are you adding your table view inside your split view?
vakio
From IB at design time. do i need to create it in code to get it to show-up right?
tg2
Well this is one solution:Create a UIViewController subclass with a xib file. In that xib file you add a tableview in IB. Still in IB, select the tableview. Here you can edit the style in the inspector. Then, in your mainwindow or wherever you have your splitview, add your subclass controller.
vakio
@vakio... looks like will do the trick. Thank you for your help!
tg2