简体   繁体   中英

How can I setup a project to operate like the 'Window-Based Application' project template from XCode 4.0, in 4.2+?

I'm using XCode 4.2, and I'm struggling with how to create a Single or MultiView application from an Empty Application project.

Previously, XCode had a Window-Based Application template, and it has been removed. After a bit of Googling, I found this highly indexed article that walks through the process of creating an Empty Application project, and manually setting up like the previous Window Based application template.

The problem that I am having is that the books that I own (that aren't to old) reference the Window-Based application, and even after following the instructions on the above linked tutorial, I can't get my projects to work. I'm missing something that bridges the gap between this web tutorial and the projects that are defined in the books.

Could some one either point me to a source or give a decent, high-level walkthrough on how to define a Single-View application, starting from an Empty Application project?

The "Empty project" already creates all window stuff for you. All you need to add is a UIViewController and link it in the app delegate.

To set the UIViewController you should use -[UIWindow setRootViewController:] . The UIViewController is the only part missing from the empty project that needs to be added for the application to work.

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