views:

32

answers:

1

iOS 3.2 introduced [UIScreen screens] which allows me to determine how many screens are connected to the device. However, I'm looking for a way to determine this on a device with a previous version, prior to 3.2. Any thoughts?

+5  A: 

No devices running pre-3.2 can have multiple screens in any meaningful programmatic way. That's why there weren't APIs for it. What are you trying to do?

quixoto
I need to check whether a TV-out cable is connected or not. If it is, then I need to use UIWebView (which has TV-Out support). If it isn't, then I need to use MPMoviePlayerController (which doesn't have TV-Out support, but allows me to provide other features such as video resuming).
David Liu
I would check for the existence of the UIScreen class. (See here: http://developer.apple.com/library/ios/documentation/General/Conceptual/iPadProgrammingGuide/StartingYourProject/StartingYourProject.html#//apple_ref/doc/uid/TP40009370-CH9-SW3.) If it doesn't exist, assume there's no TV-out cable connected as you have no way of knowing if there is or not.
Robot K
The `UIScreen` class has been around the whole time, but the `screens` property on it was new in 3.2.
quixoto