【发布时间】:2014-09-12 09:04:12
【问题描述】:
我正在使用 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];**
}
【问题讨论】:
-
使用“UIInterfaceOrientationPortrait”而不是“UIDeviceOrientationPortrait”
-
- (void)setStatusBarOrientation:(UIInterfaceOrientation)interfaceOrientation animated:(BOOL)animated -
感谢@EDUsta 成功了。
-
@EDUsta 请发表您的评论作为答案,以便我接受答案。
-
hoiberg42 有同样的答案,你也可以接受。快乐的编码:)
标签: ios objective-c xcode notifications uiinterfaceorientation