从枚举类型"UIInterfaceOrientation"到不同枚举类型"UIDeviceOrientation"的隐式转换

Guy*_*ood 2 iphone sdk xcode objective-c uideviceorientation

我收到以下代码的上述编译器警告.我理解接口和设备方向之间的区别,但不确定如何修改以删除警告.有人可以帮忙吗?

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if (ViewController != NULL) {
    [ViewController configureForDeviceOrientation:toInterfaceOrientation];
}
if (Controller != NULL) {
    [Controller configureForDeviceOrientation:toInterfaceOrientation];
}
currentOrientation = toInterfaceOrientation;
}
Run Code Online (Sandbox Code Playgroud)

Rol*_*asR 6

只是施展它 [Controller configureForDeviceOrientation:(UIDeviceOrientation)toInterfaceOrientation];

  • 实际上它被认为是"不好的做法":) (6认同)