问题是这样的,我现在想往自定义cell中传入几个判断条件,用以判断是否添加图片标签等等,请问能否在返回cell时添加用属性给cell中传值
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
tabelViewCell1 *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
NSDictionary *dic = _arr[indexPath.row];
cell.name.text = dic[@"userinfo"][@"uname"];
[cell.imgView sd_setImageWithURL:[NSURL URLWithString:dic[@"userinfo"][@"icon"]]];
cell.songId = @"ddd";
return cell;
}
songId并不能传进cell中
PHP中文网2017-04-28 09:08:11
Have you defined songId in tabelViewCell1? Check to see if there is a problem elsewhere in the code.