ios - 没有 reuseIdentifier 的 UITableViewCell

标签 ios objective-c uitableview swift uikit

据我了解,如果不期望该单元格被重用,则创建一个 reuseIdentifier 为 nil 的 UITableViewCell 是有效的,例如当该类型的单元格只有一两行时。

前几天有人提出这是不正确的。是吗?

最佳答案

不,根据 Apple 的官方文档,我认为这完全没问题:

reuseIdentifier

A string used to identify the cell object if it is to be reused for drawing multiple rows of a table view. Pass nil if the cell object is not to be reused. You should use the same reuse identifier for all cells of the same form.

https://developer.apple.com/library/IOs/documentation/UIKit/Reference/UITableViewCell_Class/index.html

关于ios - 没有 reuseIdentifier 的 UITableViewCell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26758545/

相关文章:

iPhone:如何将 UITextField 和 UITableView 放在同一个 View 上?推荐方式

swift - 在特定部分插入单元格

swift - 函数队列 - Swift

ios - 使用 SDWebImage 和 FirebaseStorageUI 删除缓存 URL

ios - touchesMoved 在 iPhone 6s 及以后的设备上被调用

objective-c - UIWebView 不打开 ms word (doc) 和 ms excel (xls) 文件

iphone - PerformSelectorInBackground 导致 EXC_BAD_ACCESS

objective-c - iOS CoreGraphics : Draw arc, 根据相交弦定理确定弧角

javascript - 无法在 iOS Safari 上更改按钮选择

ios - 如何为多点触控实现n个对象;游戏的速度、移动和交互性