编译器警告…从枚举类型\'UIInterfaceOrientation\'隐式转换为其他枚举类型\'UIDeviceOrientation\'?

问题描述

| 在Xcode中,我在下面的行中针对FBConnect发出警告:
_orientation = [UIApplication sharedApplication].statusBarOrientation;
这是完整的警告:
Implicit conversion from enumeration type \'UIInterfaceOrientation\' to different enumeration type \'UIDeviceOrientation\'
有什么想法可以解决这个问题吗? 谢谢!     

解决方法

        尝试改变
_orientation = [UIApplication sharedApplication].statusBarOrientation;
 _orientation = (UIDeviceOrientation)[UIApplication sharedApplication].statusBarOrientation;
    ,        这个怎么样?
UIDeviceOrientation _orientation = [[UIDevice currentDevice] orientation];
    

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...