属性自定义cell xib
@interface ThirdTableViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *lab3;
@property (weak, nonatomic) IBOutlet UIImageView *img;
@property (weak, nonatomic) IBOutlet UILabel *lab1;
@property (weak, nonatomic) IBOutlet UILabel *lab2;
@end
NS_ASSUME_NONNULL_END
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
ThirdTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@“cell”];
// if (self.datasource.count>0) {
ThirdModel *model = self.datasource[indexPath.row];
cell.backgroundColor = [UIColor lightGrayColor];
NSURL *url = [NSURL URLWithString:model.coverLarge];
NSData *data = [NSData dataWithContentsOfURL:url];
cell.img.image = [UIImage imageWithData:data];
cell.lab1.text = model.name;
// cell.lab2.text =model.playCount;
cell.lab3.text = model.programName;
// }
return cell;
}