对于下面的代码,我得到了上面的编译器警告。我理解接口和设备方向之间的区别,但不确定如何修改以消除警告。有人能帮上忙吗?
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if (ViewController != NULL) {
[ViewController configureForDeviceOrientation:toInterfaceOrientation];
}
if (Controller != NULL) {
[Controller configureForDeviceOrientation:toInterfaceOrientation];
}
currentOrientation = toInterfaceOrientation;
}发布于 2011-12-07 18:26:19
只需将其转换为[Controller configureForDeviceOrientation:(UIDeviceOrientation)toInterfaceOrientation];
发布于 2011-12-07 18:26:04
您的方法configureForDeviceOrientation:需要传递一个UIDeviceOrientation枚举,而不是您正在传递的UIInterfaceOrientation。
如果您更正您的方法以接受来自willRotateToInterfaceOrientation:方法的UIInterfaceOrientation,那么您就可以解决这个问题。
https://stackoverflow.com/questions/8413750
复制相似问题