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.
精彩评论