iOS知识集iOS学习iOS开发

自定义高等Cell之xib

2016-09-02  本文已影响36人  vip4iPhonr

[self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([IZGrouponCell class]) bundle:nil] forCellReuseIdentifier:ID];


    - 给cell传递模型数据

    ```objc
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // 访问缓存池
    XMGTgCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];

    // 设置数据(传递模型数据)
    cell.groupon = self.groupon[indexPath.row];

    return cell;
}
上一篇 下一篇

猜你喜欢

热点阅读