iPhone app running on iPad loads xib with ~ipad extension
I've stumbled across what I think is some odd behaviour in iOS - a search of StackOverflow hasn't turned up anything identical to my problem.
Essentially, if you have two .xib files with device modifiers (~iphone and ~ipad), and you run an iPhone app (NOT universal) on the iPad (ie within the iPhone simulator window) it will attempt to load the ~ipad xib file rather than the ~iphone xib.
Is this a bug? I would expect the ~iphone xib to be loaded. Even though the actual device is an iPad, it's emulating an iPhone, right? So surely it should load the iPhone interface file?
Steps to reproduce:
Can anyone suggest how I might work around this issue? It's complicated because my actual XCode project has multiple targets (1. iPhone-only app 2. iPad-only app) so I need to support all scenarios, hence the use of device modifiers.
我在使用笔尖时通常会这样做:
- (id)init
{
if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomiPhone )
{
nibNameString = @"mynib-iPhone";
}
else
{
nibNameString = @"mynib-iPad";
}
self = [super initWithnNibName:nibNameString bundle...
链接地址: http://www.djcxy.com/p/95714.html