How can I set a UITableView to grouped style

Solution 1:

You can do the following:

UITableView *myTable = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];

Swift 3:

let tableView = UITableView.init(frame: CGRect.zero, style: .grouped)

Solution 2:

If i understand what you mean, you have to initialize your controller with that style. Something like:

myTVContoller = [[UITableViewController alloc] initWithStyle:UITableViewStyleGrouped];

Solution 3:

I give you my solution, I am working in "XIB mode", here the code of a subclass of a UITableViewController :

-(id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithStyle:UITableViewStyleGrouped];
    return self;
}