why would [[UIScreen mainScreen] scale] return 0?
-
09-10-2019 - |
Question
I thought I was doing something relatively simple, but I guess not.
Running:
NSLog(@"%f",[[UIScreen mainScreen] scale];
returns 0.000000
The problem is that I am trying to check for a retina display and the:
if([UIScreen respondsToSelector:@selector(scale)] &&
[[UIScreen mainScreen] scale] == 2.0) {
// does not get called on an iPhone 4
}
Doesnt get called. I have tried this both in the simulator as well as on the device.
Solution
I guess the answer is How to call [[UIScreen mainScreen] scale] in a universal app for the iphone and ipad
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow