首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >枚举类型'enum UIDeviceOrientation‘到不同枚举类型' UIInterfaceOrientation’enum UIInterfaceOrientation的隐式转换

枚举类型'enum UIDeviceOrientation‘到不同枚举类型' UIInterfaceOrientation’enum UIInterfaceOrientation的隐式转换
EN

Stack Overflow用户
提问于 2014-09-12 09:04:12
回答 1查看 6.1K关注 0票数 9

我正在使用Xcode 5.0.2,并在编译目标C代码时收到以下警告:

从枚举类型'enum UIDeviceOrientation‘到不同枚举类型'UIInterfaceOrientation’(又名'enum UIInterfaceOrientation')的隐式转换

警告在viewController.m中。

代码语言:javascript
复制
-(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];**
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-09-12 09:09:40

这意味着您使用了错误的枚举类型:您使用了UIDeviceOrientation而不是UIInterfaceOrientation。要解决这个问题,只需将UIDeviceOrientationPortrait替换为UIInterfaceOrientationPortrait

票数 17
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25804545

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档