zoukankan      html  css  js  c++  java
  • xcode4.2手动添加MainWindow.xib

    参考来自:http://blog.csdn.net/muyu114/article/details/6896498

    1、新建一个空的应用程序

    Start with Empty Application template

    2、添加一个空的xib文件

     Add Empty Interface Builder document

    到这里工程的应该是下面这个样子的:

    The empty design surface of MainWindow.xib

    3、改变File’s Owner的class为UIApplication

    Change class of File's Owner to UIApplication

    4、从Library中添加一个Object,并设置其class为你对应的应用程序的类(这里是DemoAppDelegate)

    Add Object to the document

    Change class of the object to xAppDelegate

    5、添加windows,并在程序中设置windows为IBOutlet

    Add a window to the document

    The xAppDelegate.h should read something like this:

    @interface DemoAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) IBOutlet UIWindow *window; @end
    
    

    6、将windows与xib中的文件连接起来,并设置相应的代理

    Link the application delegate

    • Control-Drag from the window outlet of the xAppDelegate to the Window.

    Link the window outlet of the app delegate

    • Just for this demo, I’m adding a label to the window.

    Add a label for testing

    7、设置应用程序的主界面

    • Navigate to the project, and in the Summary tab, select MainWindow as the Main Interface.

    Set the Main Interface to MainWindow

    You can now run the project in the Simulator, and the window should show up. However there’s one last thing you might want to clean up. In xAppDelegate.m, there was actually code that creates a window as well. Just put the method

    - (BOOL) application:didFinishLaunchingWithOptions:

    in comment.

    we're done

    I hope this helps to understand exactly how an iOS app starts. The next thing you should do is add a ViewController, and push it onto the MainWindow. I’m not going to cover that here. Please leave your feedback in the comments.

  • 相关阅读:
    SQL去除重复记录
    FullCalendar应用——整合农历节气和节日
    Dropzone.js实现文件拖拽上传
    HTML5实现文件断点续传
    FullCalendar日历插件说明文档
    网络电影免会员播放器
    百度网盘搜索工具
    HTML5学习
    HTML2 -- 布局格式
    JS10 -- url问号后的数据
  • 原文地址:https://www.cnblogs.com/foxmin/p/2434437.html
Copyright © 2011-2022 走看看