gpt4 book ai didi

ios - 从枚举类型 'enum UIDeviceOrientation' 隐式转换为不同的枚举类型 'UIInterfaceOrientation' 'enum UIInterfaceOrientation

转载 作者:可可西里 更新时间:2023-11-01 03:07:07 25 4
gpt4 key购买 nike

我正在使用 Xcode 5.0.2 并在尝试编译我的 Objective-C 代码时收到以下警告:

Implicit conversion from enumeration type 'enum UIDeviceOrientation' to different enumeration type 'UIInterfaceOrientation' (aka 'enum UIInterfaceOrientation')

警告在viewController.m中

-(void)youTubeStarted:(NSNotification *)notification{
// your code here
NSLog(@"youTubeStarted");
**[[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationPortrait animated:NO];**
}

-(void)youTubeFinished:(NSNotification *)notification{
// your code here
NSLog(@"youTubeFinished");
}

- (void)youTubeVideoExit:(id)sender {
**[[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationPortrait animated:NO];**
}

最佳答案

这意味着您使用了错误的枚举类型:您使用了 UIDeviceOrientation 而不是 UIInterfaceOrientation。要解决此问题,只需将 UIDeviceOrientationPortrait 替换为 UIInterfaceOrientationPortrait

关于ios - 从枚举类型 'enum UIDeviceOrientation' 隐式转换为不同的枚举类型 'UIInterfaceOrientation' 'enum UIInterfaceOrientation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25804545/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com