Full warning:
Implicit conversion from enumeration type 'UIInterfaceOrientation' to different enumeration type 'UIDeviceOrientation'
Getting it on the line:
[self orientationChanged:interfaceOrientation];
This is the method:
- (void)orientationChanged:(UIInterfaceOrientation)interfaceOrientation
I can’t really understand where this warning is coming from.
UIDeviceOrientationrefers to the physical orientation of the device whereasUIInterfaceOrientationrefers to the orientation of the user interface. When you call your methodyou are most likely passing it a
UIDeviceOrientationwhen you should, according to the method, be using aUIInterfaceOrientation.Just to expand on this point a bit,
UIDeviceOrientationis a property of theUIDeviceclass, and there are these possible values:As for
UIInterfaceOrientation, it is a property ofUIApplicationand only contains 4 possibilities which correspond to the orientation of the status bar:To get
UIDeviceOrientation, you useand to get
UIInterfaceOrientation, you use