1、當創建UIViewController添加UITableView時,
self.tableView =[[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
2、當創建UITableViewController時,需要改變UITableViewStyle時,
使用self.tableView.style = UITableViewStyleGrouped; 會出現錯誤
查UITableViewController的SDK文檔,發現:
Table views can have one of two styles, UITableViewStylePlain and UITableViewStyleGrouped. When you create a UITableView instance you must specify a table style, and this style cannot be changed.
可以在Xib文件的屬性下直接修改為Group或Plain。