我正在使用Xcode 5.0.2,并在编译目标C代码时收到以下警告:
从枚举类型'enum UIDeviceOrientation‘到不同枚举类型'UIInterfaceOrientation’(又名'enum UIInterfaceOrientation')的隐式转换
警告在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];**
}发布于 2014-09-12 09:09:40
这意味着您使用了错误的枚举类型:您使用了UIDeviceOrientation而不是UIInterfaceOrientation。要解决这个问题,只需将UIDeviceOrientationPortrait替换为UIInterfaceOrientationPortrait。
https://stackoverflow.com/questions/25804545
复制相似问题