Compiler Warning... Implicit conversion from enumeration type 'UIInterfaceOrientation' to different enumeration type 'UIDeviceOrientation'?
11,770
Solution 1
Try changing
_orientation = [UIApplication sharedApplication].statusBarOrientation;
to
_orientation = (UIDeviceOrientation)[UIApplication sharedApplication].statusBarOrientation;
Solution 2
How about this?
UIDeviceOrientation _orientation = [[UIDevice currentDevice] orientation];
Related videos on Youtube
Author by
SimplyKiwi
Mobile Tech Lead at SimplyKiwi. Senior iOS Engineer at Rose Digital.
Updated on October 01, 2020Comments
-
SimplyKiwi over 3 years
In Xcode I get a warning in the following line for FBConnect:
_orientation = [UIApplication sharedApplication].statusBarOrientation;
This is the full warning:
Implicit conversion from enumeration type 'UIInterfaceOrientation' to different enumeration type 'UIDeviceOrientation'
Any ideas how I can fix this?
Thanks!
-
justinkoh over 10 yearsstatusBarOrientation return UIInterfaceOrientation instead of UIDeviceOrientation. The casting seems incorrect.