Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implicit conversion from enumeration type 'enum UIDeviceOrientation' to different enum type 'UIInterfaceOrientation' 'enum UIInterfaceOrientation

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];**
}
like image 652
Mihir Oza Avatar asked Sep 12 '14 09:09

Mihir Oza


1 Answers

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.

like image 140
hoiberg Avatar answered Sep 16 '22 12:09

hoiberg