相关文章推荐
飘逸的作业本  ·  設定 AutoML 進行時間序列預測 - ...·  2 月前    · 
叛逆的乒乓球  ·  時藝多媒體 - ...·  7 月前    · 
小眼睛的葡萄  ·  OneNote API 中 OneNote ...·  10 月前    · 
高兴的山羊  ·  全国体操锦标赛参赛队伍名单 ...·  1 年前    · 
豪气的冰淇淋  ·  webview加载url后页面一片空白,无报 ...·  1 年前    · 
温暖的遥控器  ·  ASP.NET Core 中文文档 第四章 ...·  1 年前    · 
Code  ›  XCode14 & iOS16 适配问题汇总开发者社区
软件 target
https://cloud.tencent.com/developer/article/2145172
踢足球的茶壶
2 年前
作者头像
傅_hc
0 篇文章

XCode14 & iOS16 适配问题汇总

前往专栏
腾讯云
开发者社区
文档 意见反馈 控制台
首页
学习
活动
专区
工具
TVP
文章/答案/技术大牛
发布
首页
学习
活动
专区
工具
TVP
返回腾讯云官网
社区首页 > 专栏 > iOS开发随笔 > XCode14 & iOS16 适配问题汇总

XCode14 & iOS16 适配问题汇总

作者头像
傅_hc
发布 于 2022-10-31 11:30:45
2K 0
发布 于 2022-10-31 11:30:45
举报

1、不升级电脑系统与 Xcode,调试iOS 16

  • 1、下载 iOS16 Support文件
  • 2、放置到Xcode DeviceSupport目录重启Xcode即可 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

2、iOS16手机开启开发者模式

iOS16手机未打开开发者模式时: 1、Xcode 无法选中 iOS16的设备,报错:developer mode disable 2、无法打开升级前编译的App

解决办法:打开调试手机-设置-隐私与安全-开发者模式-开启开发者模式(需要重启手机)

3、Pod工程中的Bundle target签名报错

  • 方法一:手动选择Pod工程中的Bundle target 签名中的Team,与主工程一致
  • 方法二:在Podfile脚本中设置你的开发者的Team ID
post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings["DEVELOPMENT_TEAM"] = "Your Team ID"
end

方法三:在Podfile脚本中设置 CODE_SIGN_IDENTITY 为空来避免报错, 这是目前在用的,也是最简单的方法

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['CODE_SIGN_IDENTITY'] = ''

4、 iOS16 横竖屏切换适配

5、Xcode14运行项目在模拟器上报如下错误:

Thread 1: "[<_UINavigationBarContentViewLayout 0x7fd1a090d730> valueForUndefinedKey:]: this class is not key value coding-compliant for the key inlineTitleView."

打开全局断点就会出现这个报错,虽然不会闪退,但是很影响调试,是Xcode的bug,但是还没有修复,找到两个比较好的办法:

  • 方法一:在全局断点上添加下面的条件
!(BOOL)[(id)[$arg1 reason] containsString:@"_UINavigationBarContentViewLayout"]
  • 方法二:添加下面代码到工程,并在启动之后马上调用
#import <objc/runtime.h>
@interface Xcode14Fixer : NSObject
@implementation Xcode14Fixer
+ (void)load
    Class cls = NSClassFromString(@"_UINavigationBarContentViewLayout");
    SEL selector = @selector(valueForUndefinedKey:);
    Method impMethod = class_getInstanceMethod([self class], selector);
    if (impMethod) {
        class_addMethod(cls, selector, method_getImplementation(impMethod), method_getTypeEncoding(impMethod));
- (id)valueForUndefinedKey:(NSString *)key
 
推荐文章
飘逸的作业本  ·  設定 AutoML 進行時間序列預測 - Azure Machine Learning | Microsoft Learn
2 月前
叛逆的乒乓球  ·  時藝多媒體 - 從印象派到現代主義─美國大都會博物館名作展
7 月前
小眼睛的葡萄  ·  OneNote API 中 OneNote 页面上的输入和输出 HTML - Microsoft Graph | Microsoft Learn
10 月前
高兴的山羊  ·  全国体操锦标赛参赛队伍名单 邹凯等明星均参加-搜狐体育
1 年前
豪气的冰淇淋  ·  webview加载url后页面一片空白,无报错-鸿蒙开发者社区-51CTO.COM
1 年前
温暖的遥控器  ·  ASP.NET Core 中文文档 第四章 MVC(3.6.1 )Tag Helpers 介绍 - .NET_CORE_COMMUNITY - 博客园
1 年前
今天看啥   ·   Py中国   ·   codingpro   ·   小百科   ·   link之家   ·   卧龙AI搜索
删除内容请联系邮箱 2879853325@qq.com
Code - 代码工具平台
© 2024 ~ 沪ICP备11025650号