Fixed a screen rotation problem cause by iOS 8.0 API changes.