问题
I have a table that I created within xcode so there is no nib file in this case. I want to make my table into the 'Grouped' style but im not sure how.
I think it has somthing to do with the method below, the problem is Im not really sure how to call it, I do understand how methods work I'm just not too sure on where to start with this one:
- (id)initWithFrame:(CGRect)frame style:(UITableViewStyle)UITableViewStyleGrouped
So could someone tell me how to call it? The problem is that its not a method I wrote its a built in one so I could put that line into my header file but how would I use it in my implementation file?
Thanks guys,
回答1:
It sounds like you need to get a better understanding of how objective-c works. What you have given us is not a method, but a method declaration. In your controllers viewDidLoad:, you would do something like:
table = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStyleGrouped];
来源:https://stackoverflow.com/questions/2512417/how-to-change-to-a-grouped-table-view-in-xcode-without-using-interface-builder