How do I run a universal app on the iPhone 3.1.3 simulator?

前端 未结 3 936
悲&欢浪女
悲&欢浪女 2021-01-31 12:32

I\'m working on a new app that I want to be universal for the iPhone and iPad. I started out with the \"Create a Window-based app\" wizard, and it created separate app delegates

3条回答
  •  旧时难觅i
    2021-01-31 12:52

    Quite the opposite. A universal app runs the same binary on iPhone and iPad so you cannot use conditional compilation to differentiate between the two version. But you need to use the macro Apple cites in the documentation:

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
        // iPad-specific code
    } else {
        // iPhone-specific code
    }
    

提交回复
热议问题