I have an iPad app that I would like to make Universal, however this seems alarmingly difficult. I’ve changed things around so that I support both builds, but when building, I get lots of errors about using UIPopOvers. Here’re my questions:
- Why does
UI_USER_INTERFACE_IDIOM()not compile or register on 3.1.3? - Can I conditionally have variables in a class definition based on
UI_USER_INTERFACE_IDIOM()? - If not, should I make two different view controllers?
Thanks!
The
UI_USER_INTERFACE_IDIOMmacro is only available starting with 3.2. Same restrictions for theuserInterfaceIdiomproperty of UIDevice. This means that you can only get universal application starting with SDK 3.2.No. The
UI_USER_INTERFACE_IDIOMmacro is only a runtime shortcut to get the current UI idiom of the device.If you have very different UI between the two devices, it is wiser to use two different view controllers, and to create the right one at runtime (in the application controller for example) by using the
UI_USER_INTERFACE_IDIOMmacro.