简体   繁体   中英

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

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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