ios - UITableViewCells 会在不同的 UITableViews 实例中重复使用吗?

标签 ios objective-c uitableview

我有一个自定义 UITableView展示一组自定义UITableViewCells .这个tableView将在几个不同的 UIViewControllers 中实例化.在某些用例中,不同的 viewControllers将同时存在于 UINavigationController ,例如:
UIViewController viewA;推送到 UIViewController viewB;两个 Controller 都有自己的UITableView .两个tableViews有自己的一套UITableViewCellsreuseIdentifier .

是否会发生 UITableViewCell来自 viewA正在 viewB 中重复使用?

最佳答案

根据the docs , 不。

A UITableView object maintains a queue (or list) of the currently reusable cells, each with its own reuse identifier, and makes them available to the delegate in the dequeueReusableCellWithIdentifier: method



实例将维护自己的重用队列。

关于ios - UITableViewCells 会在不同的 UITableViews 实例中重复使用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30100208/

相关文章:

objective-c - NSKeyedUnarchiver unarchiveObjectWithData 崩溃 - 无法捕获异常?

ios - 当进入结果 View 并返回时,带有 UISearchController 的 UITableView 进入导航栏下方

ios - 为什么更改 TableViewCell 中的开关会影响其他单元格中的其他开关?

ios - 在 UITableView 中设置复选标记

ios - App Store Connect 验证时出现 bundle 标识符 "org.cocoapods.device-id"错误

ios - 我不应该在 viewDidLoad 中使用 UIButton 的 addTarget

ios - 在应用程序内购买

Objective-c:使用带有导航栏的第二个 View 启动应用程序

ios - 如何在 iOS 中识别表格行?

ios - 当用户点击 "Back"按钮时调用委托(delegate)