How to Set UITableViewCellStyleSubtitle and dequeueReusableCell in Swift?

前端 未结 13 997
攒了一身酷
攒了一身酷 2020-12-01 05:03

I\'d like a UITableView with subtitle-style cells that use dequeueReusableCellWithIdentifier.

My original Objective-C code was

13条回答
  •  伪装坚强ぢ
    2020-12-01 05:43

    Make sure that you are not registering any cell to the tableview.

    If you did so, dequeueReusableCellWithIdentifier will always give a non optional cell so UITableViewCellStyle.Subtitle will never initiate.

提交回复
热议问题