iPhone:使用 *.m & 复制时 Nib 文件无法正常工作*.h 文件从 1 个项目到另一个项目
我一直在分段构建项目,在单独的演示项目中对整体的不同方面进行原型设计。我现在正在将类和 nib 文件从原型迁移到目标项目,当我这样做时,nib 文件的行为与原型中的行为不同。我一直在使用分层项目文件视图中可用菜单中的“添加现有文件”项进行迁移。
有没有人经历过这样的行为,如果有的话,您对解决问题有什么建议吗?在许多情况下,我只是在目标中重新创建了 nib 文件,这已经起作用了,但我正在尝试使用 3 个不同的视图迁移一个相当复杂的 nib 文件。如果可以避免的话,我宁愿不要手动重新创建它。
我在 Leopard 上使用 Xcode 3.1.4 和 iPhone SDK 3.1.2。
I've been building projects in pieces, prototyping different aspects of the whole in separate demo projects. I'm now in the process of migrating class and nib files from the prototypes into the target project and when I do so the nib files aren't behaving as they did in the prototype. I've been doing the migration by using the "Add Existing Files" item in the menu available in the hierarchical project file view.
Has anyone experienced behavior like this, and if you have do you have any suggestions for fixing the problem? In a number of cases I've simply recreated the nib file in the target and that has worked, but I'm trying to migrate a fairly complicated nib file with 3 different views. I'd prefer not to recreate it by hand if I can avoid it.
I'm using Xcode 3.1.4 on Leopard with iPhone SDK 3.1.2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当您按照您描述的方式迁移文件时。 IB 中的连接不一定会自动为您完成。然后你必须进入 IB 并确保所有的网点都已设置,并且课程拥有你想要的所有权。
When you migrate files in the manner you described. The hookups in IB aren't necessarily done for you automatically. You then have to go into IB and make sure all of the outlets are set, and the classes have the ownership you intend.
您必须在项目
Info.plist
文件中设置主 NIB 文件。You have to set the main NIB file in your project
Info.plist
file.我也有同样的问题。我做了以下,可能对你有帮助::
1. 将 nib 文件与 .h 和 .m 文件一起添加到新项目中。
2. 断开所有连接并重新建立所有连接并保存。
4. 同时断开与文件所有者的连接并重新建立。
5. 然后重新进行所有连接。
这对我有用
I also had the same problem. I did following, may be helpful for you ::
1. Add the nib file to your new project along with your .h and .m file.
2. Break all the connection and remake all the connection and do save.
4. Also break connection with file owner and re make it.
5. And then make all connections again.
This worked for me