在Storyboard Xcode 4中添加的用于视图控制器的.h和.m文件 [英] .h and .m files for view controllers added within storyboard xcode 4

查看:98
本文介绍了在Storyboard Xcode 4中添加的用于视图控制器的.h和.m文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用情节提要创建了应用程序流程.这是一个基于导航的情节提要布局,其中包含一些视图.我在哪里可以创建.h和.m文件来实际使该应用程序执行操作?由于故事板的缘故,该应用程序的一般导航流程很好,但是我需要在视图中添加自己的代码.谢谢!

I've created the flow of my application with storyboard. It's a navigation based storyboard layout with a few stacks of views. Where can I create .h and .m files to actually make the app DO things? The general navigational flow of the app is just fine as a result of story board, but I need to add my own code to the views. Thanks!

推荐答案

转到文件"->新建"->新文件",并为每个视图创建一个没有xib/nib的UIViewSubclass.这将创建.h和.m文件.然后,在情节提要中选择视图,然后转到右列视图中的Identity Inspector.在自定义类"->类"下,选择刚创建的新UIViewSubclass(按名称).这会将视图与标题和实现文件链接起来.

Go to File->New->New File and create a UIViewSubclass without the xib/nib for each view that you have. This will create the .h and .m files. Then, select the view in the storyboard and go to Identity Inspector in the right column view. Under Custom Class->Class, select the new UIViewSubclass (by name) that you just created. This will link the view with the header and implementation files.

这篇关于在Storyboard Xcode 4中添加的用于视图控制器的.h和.m文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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