Changed the way to obtain the device orientation in the Viewcontroller.m