美文网首页
TableView必须实现的数据源方法

TableView必须实现的数据源方法

作者: 忘惘的小风扇 | 来源:发表于2016-07-04 22:48 被阅读337次

UITableView继承于UIScrollView,使得视图实现可以上下滚动。其中,实例化视图时,必须通过UITableVIewDataSource方法来实现数据源的配置;UITableViewDelegate方法一般用于视图的基本样式以及捕捉单元格被选中的事件。

1-(UITableViewCell *)tableView:(UITableView *)tableView CellForRowAtIndexPath:(NSIndexPath *)indexPath;
2-(NSInteger)numberOfSectionInTableView:(UITableView *)tableView;
3-(NSInteger)tableView:(UITableView *)tableView numberOfRowInSection:(NSInteger)section;

以上三个方法,是最基本的也是必须要实现的三种数据源方法:分别指的是每行的Cell,组数,每组的个数;


相关文章

网友评论

      本文标题:TableView必须实现的数据源方法

      本文链接:https://www.haomeiwen.com/subject/jmxhjttx.html