I am making a universal iPad / iPhone application that can use the VGA connector for the iPad to reflect the contents of the application on an external screen. However, the iPhone does not have this feature. given the following code
#ifdef UI_USER_INTERFACE_IDIOM
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
NSLog(@"this code should not execute on iphone");
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(screenInfoNotificationReceieved:)
name:UIScreenDidConnectNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(screenInfoNotificationReceieved:)
name:UIScreenDidDisconnectNotification
object:nil];
}
#endif
I get this error on the phone on startup (works fine on ipad) "dyld: Symbol not found: _UIScreenDidConnectNotification"
presumably because UIScreenDidConnectNotification does not yet exist in 3.13. How can I check this at runtime?
UPDATED ifdef statements have been added to test the ipad interface, but getting the same result!
NSLog, , if . , , - ...