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

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

问题描述

我可以设计自定义UITableViewCells,并使用 http://forums.macrumors.com/showthread.php?t=545061 。但是,使用该方法不再允许您使用reuseIdentifier初始化单元格,这意味着您必须在每次调用时创建每个单元格的全新实例。有没有人想出一个好的方法仍然缓存特定的单元格类型重用,但仍然能够在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?

推荐答案

p>只需使用适当的方法签名实现一个方法:

Just implement a method with the appropriate method signature:

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

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

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