ios - 是否可以在 for/in 循环中创建 UITableViewCells?

标签 ios objective-c uitableview

我正在调用一个函数,在该函数中检索带有需要在 tableviewCells 中显示的数据的 NSDictionary 。是否可以调用方法

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

用另一种方法?

最佳答案

不可能在另一个方法中调用一个特定的方法。但是,您可以在任何方法中调用 [self.tableView reloadData]。这会调用所有 UITableView 委托(delegate)方法,其中包括 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

关于ios - 是否可以在 for/in 循环中创建 UITableViewCells?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25312841/

相关文章:

iphone - 检测 UITableViewCell 的拖动事件

ios - 设备与模拟器上的 UILabel 位置不一致

ios - 用于从本地数据库进行过滤的 SQLite 查询是什么?

ios - 布局 View 位于另一个以编程方式创建的 View 下方

ios - 同时在两个不同的类中调用协议(protocol)

swift - 在 Swift 的 UITableView 中添加、列出和删除项目

iphone - 为什么tableview不显示任何数据?

iphone - stringWithCString 已弃用...那么我如何使用 sysctlbyname 返回的 char*?

objective-c - 如何创建一个c数组?

ios - 自定义 tableview 单元格未出现