I'm making a universal iPad/iPhone app which can use the iPad's VGA out connector to mirror the content of the app on an external screen. However, the iPhone does not have this functionality. 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 at launch (works fine in ipad) "dyld: Symbol not found: _UIScreenDidConnectNotification"
presumably because UIScreenDidConnectNotification doesnt' exist yet in 3.13. How do I check for this at runtime?
UPDATED added ifdef statements to check for ipad interface but getting the same result!
UPDATED added NSLog statement to make sure the code inside the if statement is not being called. The crash seems to occur before any other code is executed...