dequeueReusableCellWithIdentifier never returns nil

前端 未结 4 517
臣服心动
臣服心动 2020-12-06 00:30

I am using a custom UITableViewCell in my UITableView but the problem is that the cell is never nil when calling the dequeueReusableCellWithIdentifier. Why is this ?

4条回答
  •  無奈伤痛
    2020-12-06 00:56

    I don't believe it is supposed to return nil. Why do you want it to?

    The method dequeueReusableCellWithIdentifier returns a Cell that is about to be displayed, so it's actually good that it is not null - that way you can modify it as needed.

提交回复
热议问题