iOS开发之自定义UITableViewCell
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 等高的Cell 一、storyboard方式 创建一个继承自UITableViewCell的子类 在storyboard中 - 往cell里面增加需要用到的子控件 - 设置cell的重用标识 - 设置cell的class为我刚才创建的那个Cell类型XXDealCell 3. 在控制器中 - 利用重用标识找到cell - 给cell传递模型数据 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.deals.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *ID = @"deal"; XXDealCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; //取出模型数据 cell.deal = self.deals[indexPath.row]; return cell; } 4