zoukankan      html  css  js  c++  java
  • Is a MainWindow.xib truly needed in iOS application?

    I think the reason why it's now absent is that creating a window programmatically is much more efficient than opening a xib file and unarchiving the objects. Generally, if you can do it in one line of code, you should do that in code.

    It is has always been an option not to use MainWindow.xib. The UIWindow could be loaded programmatically by the doing the following:

    1) Making sure that the call to UIApplicationMain in main.m looks like this:

    UIApplicationMain(argc, argv,nil,@"MyAppDelegateClassName");

    rather than this:

    UIApplicationMain(argc, argv,nil,nil);

    2) Making sure that Info.plist does not have a value of "MainWindow.xib" as the main nib file.

    3) Loading the UIWindow programmatically in the app delegate.

    So, no, you don't have to use MainWindow.xib and, actually, you never have. You could always do things programmatically.

    It is a good question why Apple made this change in the default Xcode settings, and I don't know the answer. But it may have to with performance or the transition to ARC or small application file sizes or something else altogether.

  • 相关阅读:
    root----TH1
    linux debug
    python基础 文件操作
    linux下挂载硬盘
    安装双系统
    路由器相关
    007-python 获取网卡实时流量(转)
    ssh密钥登录失败(转)
    当while read line 遇到 ssh(转)
    python实用功能之001-邮件发送
  • 原文地址:https://www.cnblogs.com/StarMud/p/2792544.html
Copyright © 2011-2022 走看看