语义问题:初始化时不兼容的指针类型NewCustomCell *
带有类型的表达式UITableViewCell *
static NSString *cellID = @"customCell";
NewCustomCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
[tableView dequeueReusableCellWithIdentifier:cellID]
返回一个具有类型的对象UITableViewCell *
。如果您知道单元格始终是类型NewCustomCell *
,然后你可以告诉编译器通过强制转换来期待这一点。就像这样:
NewCustomCell *cell = (NewCustomCell *) [tableView dequeueReusableCellWithIdentifier:cellID];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)