I have a UIViewController with a table view in it. In my storyboard, I just dragged a generic table view element into this controller view, and set its content to be static cells. And I make several sections in the table view, and each section is filled with my buttons, text fields and other controls. But when I segue to this controller, it's crashed at:
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
Before I added the table view with static cell, there is no error. And I searched some of the similar problems, and changed the controller's super class to be UITableViewController, but I didn't implement the
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
delegate, since I think there is no need to implement that if using static cells. Does anybody know what is the problem?And how to fix that.
I solved this problem by dragging a whole UItableViewController in my story board, and copied my controls into this new view controller. It looks like dragging a table view won't work with static cell.