I am using Xcode 5.0.2 and getting the following warning when trying to compile my objective C code:
Implicit conversion from enumeration type 'enum UIDeviceOrientation' to different enumeration type 'UIInterfaceOrientation' (aka 'enum UIInterfaceOrientation')
The warning is in viewController.m
-(void)youTubeStarted:(NSNotification *)notification{
// your code here
NSLog(@"youTubeStarted");
**[[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationPortrait animated:NO];**
}
-(void)youTubeFinished:(NSNotification *)notification{
// your code here
NSLog(@"youTubeFinished");
}
- (void)youTubeVideoExit:(id)sender {
**[[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationPortrait animated:NO];**
}
It means that you have used the wrong enum type: You have used UIDeviceOrientation
instead of UIInterfaceOrientation
.
To fix this, simply replace UIDeviceOrientationPortrait
with UIInterfaceOrientationPortrait
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With