gpt4 book ai didi

ios - 使用 UItableViewCell 类型的表达式初始化 'CustomCellView *' 的不兼容指针类型

转载 作者:IT王子 更新时间:2023-10-29 08:08:20 26 4
gpt4 key购买 nike

你能帮我理解和/修复下面的错误吗?我不明白 CustomCellViewUItableViewCell 的子类。代码已编译,但警告仍然存在:

Incompatible pointer type initializing 'CustomCellView *' with an expression of type `UItableViewCell`

我突出显示了下面的第二行:

static NSString *CellIdentifier = @"CustomCell";
CustomCellView *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

最佳答案

static NSString *CellIdentifier = @"CustomCell";
CustomCellView *cell =(CustomCellView*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

您需要在您的单元格中输入 cast

关于ios - 使用 UItableViewCell 类型的表达式初始化 'CustomCellView *' 的不兼容指针类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7372769/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com