How to link a .xib file to a class file with Xcode 4

前端 未结 4 1531
陌清茗
陌清茗 2020-12-08 10:12

have started a universal project under the new Xcode4. My Application works on both iPhone & iPad devices but not well design for the iPad. I have 2 .xib file for the Ma

4条回答
  •  無奈伤痛
    2020-12-08 10:48

    You want to create a new UIViewController subclass, not a new UI file. That will create your .xib as well as the class files (.m and .h). The template is under Cocoa Touch.

    Wanting to link to an existing view controller is probably not a good idea. If you're following the MVC (Model-View-Controller) design pattern, you have your data classes and view controllers separated. If you can, move things out of your MainViewController class and into a data class it owns. Then create another view controller for iPad and make it own an instance of your data class you created.

提交回复
热议问题