开发者

Incompatible pointer types Xcode

Semantic Issue: Incompatible p开发者_如何学Goointer types initializing NewCustomCell * with an expression of type UITableViewCell *

static NSString *cellID = @"customCell";

NewCustomCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];


[tableView dequeueReusableCellWithIdentifier:cellID] returns an object with type UITableViewCell *. If you know that the cell will always be of type NewCustomCell *, then you can tell the compiler to expect that with a cast. Like so:

NewCustomCell *cell = (NewCustomCell *) [tableView dequeueReusableCellWithIdentifier:cellID];


You have to cast it.

NewCustomCell *cell = (NewCustomCell *)[tableView dequeueReusableCellWithIdentifier:cellID];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜