title: iOS: Using device modifiers for loading xib files?
body: <p>You can use a device modifier (i.e., ~ipad) to provide a device-specific key in Info.plist, and to specify a device-specific launch image (Default.png for iPhone, and Default~ipad.png for iPad, for example).  Those two things are specifically mentioned in <a href="http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/BuildTimeConfiguration/BuildTimeConfiguration.html" rel="noreferrer">Apple Docs</a>, but they don't say that this will work for any other kinds of files.</p>
  
  <p>I've discovered (quite by accident) that this works for loading .xib files via <code>initWithNibName:bundle:</code>.  So for example, I can have MyView.xib and MyView~ipad.xib, and this code:</p>
  
  <pre><code>MyViewController *viewController = [[MyViewController alloc] 
                                       initWithNibName:@"MyView" bundle:nil];
  </code></pre>
  
  <p>... will totally load MyView~ipad.xib on an iPad, and MyView.xib on other devices.</p>
  
  <p>So, 1) Is this documented somewhere?  I sure couldn't find it any any Apple docs.  It's sure handier than checking UI_USER_INTERFACE_IDIOM() and hardcoding two different nib names everywhere, but I kinda don't trust it if it isn't documented.</p>
  
  <p>And, 2) Does anyone know what version of iOS this started working in?  I've only tried it in 4.2, and it works there.  Device modifiers in general (even for the documented things listed above) are 4.0 minimum.</p>