编译器警告…从枚举类型\'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];