iOS tableview的过程
1、h文件 声明
viewcontroller <UITableViewDataSource,UITableViewDelegate>
2、m文件 设置代理
self.tableView.delegate=self;
self.tableView.dataSource=self;
3、m文件 实现必须的方法
//返回多少行cell
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
//返回cell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
4、非必需
//点击cell触发
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
//设置cell高
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;