tg2
tg2

Reputation: 2200

UITableViewController init method not called

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?

Upvotes: 7

Views: 2052

Answers (2)

bartolo-otrit
bartolo-otrit

Reputation: 2519

Same problem. In my case

- (id) initWithCoder:(NSCoder *) coder

is called

Upvotes: 8

vakio
vakio

Reputation: 3177

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

edit: waychick was right. - (id) initWithCoder:(NSCoder *) coder is called.

Upvotes: 8

Related Questions