开发者

loading different root view controller on starting of an universal app

开发者 https://www.devze.com 2023-02-18 00:28 出处:网络
I am trying to create an universal app for iOS. I want to load different xib based on device it being run. Do I need to create two separate app delegate开发者_如何转开发 classes?

I am trying to create an universal app for iOS. I want to load different xib based on device it being run. Do I need to create two separate app delegate开发者_如何转开发 classes?

Any help would be appreciated.


No, you don't need to use two different app delegates, but you can: what I've done in some apps is to create an app delegate base class and each the iPhone and iPad versions derived from that base class to implement the different behavior. See the answer of hotpaw2 to this question.

In your Info.plist you can specify different XIBs for iPhone and iPad, and in each XIB you can specify the app delegate class. Either use the same one or different ones, whichever suits you best. See also this article.

This nice blog post also shows how to load different XIBs manually depending on the device being run on.

0

精彩评论

暂无评论...
验证码 换一张
取 消