How to get screen size using code on iOS?

You can use the bounds property on an instance of UIScreen: CGRect screenBound = [[UIScreen mainScreen] bounds]; CGSize screenSize = screenBound.size; CGFloat screenWidth = screenSize.width; CGFloat screenHeight = screenSize.height; Most people will want the main screen; if you have a device attached to a TV, you may instead want to iterate over UIScreens and get … Read more

Is [UIScreen mainScreen].bounds.size becoming orientation-dependent in iOS8?

Yes, it’s orientation-dependent in iOS8, not a bug. You could review session 214 from WWDC 2014 for more info: “View Controller Advancements in iOS 8” Quote from the presentation: UIScreen is now interface oriented: [UIScreen bounds] now interface-oriented [UIScreen applicationFrame] now interface-oriented Status bar frame notifications are interface-oriented Keyboard frame notifications are interface-oriented

Detect Retina Display

In order to detect the Retina display reliably on all iOS devices, you need to check if the device is running iOS4+ and if the [UIScreen mainScreen].scale property is equal to 2.0. You CANNOT assume a device is running iOS4+ if the scale property exists, as the iPad 3.2 also contains this property. On an … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)