【发布时间】:2023-05-29 18:44:01
【问题描述】:
我想在 info.plist 中获取支持的界面方向的 item0。
为了得到这样的东西:
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
NSArray *supportedOrientations = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UISupportedInterfaceOrientations"];
return supportedOrientations[0];
}
但是我当然有一个不兼容类型错误:
Incompatible pointer to integer conversion returning 'id' from a function with result type
如何解决?
【问题讨论】:
-
信息字典中的条目可能是一个字符串。您是否尝试过制作自己的转换函数?
标签: ios uiinterfaceorientation info.plist