xcode4 中的新 xib
我开发了一个 iPhone 应用程序。现在我想在 iPad 上做。为此,我必须创建新的 .XIB 文件并链接到他的类。
我不知道如何在 xcode4 中创建新的 .xib。有人可以帮助我吗?
现在,为了解决这个问题,我用他的.XIB创建一个新文件,删除.m和.XIB。 .h 并将 .XIB 与我的类链接。
谢谢。
I develped an iPhone app. Now i would like to do it in iPad. To do this I have to create the new .XIB files and linked to his Class.
I don't know how to create a new .xib in xcode4. Could somebody help me?
Now, to solve this problem, I create a new file with his .XIB, delete the .m & .h and link the .XIB with my class.
Thanyou.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了在 XCode 4 中创建 XIB 文件,只需进入主菜单 File->New->New File...,然后从 iOS 部分选择 User Interface。然后选择查看(如果这是您想要的)、设备系列并最后保存。
希望有帮助。
In order to create a XIB file in XCode 4, just go to the main menu, File->New->New File..., and from there choose User Interface from the iOS section. Then choose View (if that's what you want), device family and finally save.
Hope it helps.
我们还需要另外两个 nib 文件,一个用于我们刚刚创建的两个内容视图。要创建它们,请单击“组和组”中的“资源”文件夹。文件窗格,以便我们在正确的位置创建它们,然后按 ␣N 或再次从“文件”菜单中选择“新建文件...”。这次,当助手窗口出现时,选择iPhone OS下的用户界面
标题位于左窗格中。
选择“查看 XIB”模板的图标,这将创建一个带有内容视图的笔尖,然后单击“下一步”按钮。当提示输入文件名时,输入 BlueView.xib。重复这些步骤以创建第二个名为 YellowView.xib 的 nib 文件。完成此操作后,您就拥有了所需的所有文件。是时候开始将所有内容连接在一起了。
We also need two more nib files, one for each of the two content views we just created. To create these, single-click the Resources folder in the Groups & Files pane so that we create them in the correct place, and then press ␣N or select New File... from the File menu again. This time, when the assistant window comes up, select User Interfaces under the iPhone OS
heading in the left pane .
Select the icon for the View XIB template, which will create a nib with a content view, and then click the Next button. When prompted for a filename, type BlueView.xib. Repeat the steps to create a second nib file called YellowView.xib. Once you’ve done that, you have all the files you need. It’s time to start hooking everything together.