简体   繁体   English

故事板xcode 4中添加的视图控制器的.h和.m文件

[英].h and .m files for view controllers added within storyboard xcode 4

I've created the flow of my application with storyboard. 我用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? 我在哪里可以创建.h和.m文件来实际让应用程序做事情? 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! 谢谢!

Go to File->New->New File and create a UIViewSubclass without the xib/nib for each view that you have. 转到File-> New-> New File并为您拥有的每个视图创建一个不带xib / nib的UIViewSubclass。 This will create the .h and .m files. 这将创建.h和.m文件。 Then, select the view in the storyboard and go to Identity Inspector in the right column view. 然后,在故事板中选择视图,并转到右侧列视图中的Identity Inspector。 Under Custom Class->Class, select the new UIViewSubclass (by name) that you just created. 在Custom Class-> Class下,选择刚刚创建的新UIViewSubclass(按名称)。 This will link the view with the header and implementation files. 这将链接视图与标头和实现文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM