IOS开发-类实现一个协议

来源:互联网 发布:阿里云打开3306端口 编辑:程序博客网 时间:2024/05/29 17:00

@interface ios_t017_tableview_1_basicViewController :UIViewController<UITableViewDataSource>


本类实现了UITableViewDataSource,此协议有一下方法:


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

    return 1;

}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 1;

}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

  return cell;    

}