objective-c - 如何从table向cell中传值?
仅有的幸福
仅有的幸福 2017-04-28 09:06:11
0
1
710

问题是这样的,我现在想往自定义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中

仅有的幸福
仅有的幸福

全部回复(1)
Ty80

在tabelViewCell1中你定义songId了吗?检查一下吧 是不是代码其他地方有问题。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!