1.在ViewController中添加TableView
stroyboard或者code添加
2.在ViewController.m中加入<UITableViewDataSource>协议 或
在其他类中添加此协议
3.在ViewController.m中使此TableView的数据源为本身 或
其他类
4.添加
(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView //返回组数
(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section //返回每组的cell数
(NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section //返回每个组的组名
(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath //返回cell
等方法
原文:http://www.cnblogs.com/Thkeer/p/5080558.html