2

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

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if (ViewController != NULL) {
    [ViewController configureForDeviceOrientation:toInterfaceOrientation];
}
if (Controller != NULL) {
    [Controller configureForDeviceOrientation:toInterfaceOrientation];
}
currentOrientation = toInterfaceOrientation;
}
4

2 回答 2

6

就投吧[Controller configureForDeviceOrientation:(UIDeviceOrientation)toInterfaceOrientation];

于 2011-12-07T10:26:19.220 回答
2

您的方法configureForDeviceOrientation:期望传递一个UIDeviceOrientation枚举,而不是UIInterfaceOrientation您传入的一个。

如果您更正您的方法以接受UIInterfaceOrientation来自该willRotateToInterfaceOrientation:方法的 a,那么您将解决问题。

于 2011-12-07T10:26:03.637 回答