从 Nib 加载可重用的 UITableViewCell [英] Loading a Reusable UITableViewCell from a Nib

查看:26
本文介绍了从 Nib 加载可重用的 UITableViewCell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够设计自定义 UITableViewCells 并使用 http://forums.macrumors.com/showthread.php?t=545061.但是,使用该方法不再允许您使用重用标识符初始化单元格,这意味着您必须在每次调用时为每个单元格创建全新的实例.有没有人想出一种仍然缓存特定单元格类型以供重用的好方法,但仍然能够在 Interface Builder 中设计它们?

I am able to design custom UITableViewCells and load them just fine using the technique described in the thread found at http://forums.macrumors.com/showthread.php?t=545061. However, using that method no longer allows you to init the cell with a reuseIdentifier which means you have to create whole new instances of each cell at every call. Has anyone figured out a good way to still cache particular cell types for reuses, but still be able to design them in Interface Builder?

推荐答案

只需实现一个具有适当方法签名的方法:

Just implement a method with the appropriate method signature:

- (NSString *) reuseIdentifier {
  return @"myIdentifier";
}

这篇关于从 Nib 加载可重用的 UITableViewCell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆