如何在Xcode 4中使用nib创建自定义UITableViewCell? [英] How do I create a custom UITableViewCell with nib in Xcode 4?

查看:141
本文介绍了如何在Xcode 4中使用nib创建自定义UITableViewCell?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在XCode 3中,我可以选择在创建表视图单元子类时创建一个nib。在Xcode 4中,它只生成h / m文件。

In XCode 3, I could elect to make a nib when creating a table view cell subclass. In Xcode 4, it only makes the h / m files.

如何使用xib文件创建子类?

How do I make the subclass with a xib file?

编辑:请参阅以下屏幕截图:

see screen shots below:

编辑:
此外,有没有办法自动创建UITableViewCell笔尖,以及h和m文件,所有前有线并准备编辑?

Additionally, is there any way to create the UITableViewCell nib automatically, along with the h and m files, all pre-wired and ready to edit?

推荐答案

博客文章介绍了如何手动添加。

This blog post describes, how to add it manually.

编辑
iOS4中的
+行

edit
in iOS4+ the line

NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];

可以通过 UINib

博客文章如何做到这一点,以及如何保持向后兼容。

can be replaced by a more efficient nib handling via UINib.
see this blog post how to do it, and how to stay backwards compatible.

这篇关于如何在Xcode 4中使用nib创建自定义UITableViewCell?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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