Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 724
tg2 Avatar asked Aug 12 '10 14:08

tg2


2 Answers

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

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

like image 71
vakio Avatar answered Oct 21 '22 05:10

vakio


Same problem. In my case

- (id) initWithCoder:(NSCoder *) coder

is called

like image 20
bartolo-otrit Avatar answered Oct 21 '22 06:10

bartolo-otrit