当前位置: 首页 > news >正文

iOS 17 及 Xcode 15.0 Beta7 问题记录

1、iOS 17 真机调试问题

iOS 17之后,真机调试Beta版本必须使用Beta版本的Xcode来调试,用以前复制DeviceSupport 方式无法调试,新的Beta版本Xcode中,已经不包含 iOS 17目录。如下图:
在这里插入图片描述
解决方案:
在这里插入图片描述

1)下载最新的Beta 版本Xcode 15
2)运行命令defaults write com.apple.dt.Xcode DVTEnableCoreDevice enabled
此时旧版本Xcode 将会出现一个 CoreDevice ,这时候就可以继续Debug调试了

在这里插入图片描述

2、Xcode 15 Beta版本运行项目报错

运行旧版本项目编译报以下错误
Showing All Messages Assertion failed: (aliasSectionNum == sectionNum && "alias and its target must be located in the same section"), function assignAliasAtomOffsetInSection, file Layout.cpp, line 3248.
在这里插入图片描述

解决:Build Settings -> Other Linker Flags 中添加 -ld64

在这里插入图片描述

3、UIGraphicsBeginImageContextWithOptions 方法崩溃(Crash)

*** Assertion failure in void _UIGraphicsBeginImageContextWithOptions(CGSize, BOOL, CGFloat, BOOL)(), UIGraphics.m:410
在这里插入图片描述
解决方案:将下面代码替换

UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, self.contentsScale);CGContextRef context = UIGraphicsGetCurrentContext();if (self.opaque) {CGSize size = self.bounds.size;size.width *= self.contentsScale;size.height *= self.contentsScale;CGContextSaveGState(context); {if (!self.backgroundColor || CGColorGetAlpha(self.backgroundColor) < 1) {CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);CGContextAddRect(context, CGRectMake(0, 0, size.width, size.height));CGContextFillPath(context);}if (self.backgroundColor) {CGContextSetFillColorWithColor(context, self.backgroundColor);CGContextAddRect(context, CGRectMake(0, 0, size.width, size.height));CGContextFillPath(context);}} CGContextRestoreGState(context);}task.display(context, self.bounds.size, ^{return NO;});UIImage *image = UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();self.contents = (__bridge id)(image.CGImage);

替换为:

UIGraphicsImageRendererFormat *format = [[UIGraphicsImageRendererFormat alloc] init];format.opaque = self.opaque;format.scale = self.contentsScale;UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:self.bounds.size format:format];UIImage *image = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {CGContextRef context = rendererContext.CGContext;if (self.opaque) {CGSize size = self.bounds.size;size.width *= self.contentsScale;size.height *= self.contentsScale;CGContextSaveGState(context); {if (!self.backgroundColor || CGColorGetAlpha(self.backgroundColor) < 1) {CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);CGContextAddRect(context, CGRectMake(0, 0, size.width, size.height));CGContextFillPath(context);}if (self.backgroundColor) {CGContextSetFillColorWithColor(context, self.backgroundColor);CGContextAddRect(context, CGRectMake(0, 0, size.width, size.height));CGContextFillPath(context);}} CGContextRestoreGState(context);}task.display(context, self.bounds.size, ^{return NO;});}];self.contents = (__bridge id)(image.CGImage);
http://www.lryc.cn/news/138175.html

相关文章:

  • docker-maven-plugin直接把镜像推到私有仓库
  • 2023年机器学习项目—布匹缺陷检测
  • RabbitMQ---订阅模型分类
  • pycharm添加虚拟环境以及虚拟环境安装pytorch
  • Git企业开发控制理论和实操-从入门到深入(三)|分支管理
  • 【VsCode】SSH远程连接Linux服务器开发,搭配cpolar内网穿透实现公网访问(1)
  • LC-1267. 统计参与通信的服务器(枚举 + 计数)
  • Linux TCP协议——三次握手,四次挥手
  • 人机对抗智能-部分可观测异步智能体协同(POAC)
  • 数学——七桥问题——图论
  • python 模块lxml 处理 XML 和 HTML 数据
  • SpringBoot 统⼀功能处理
  • hadoop 报错 java.io.IOException: Inconsistent checkpoint fields
  • workbench连接MySQL8.0错误 bad conversion 外部组件 异常
  • Qt Scroll Area控件设置,解决无法显示全部内容,且无法滚动显示问题。
  • 【Java架构-包管理工具】-Maven私服搭建-Nexus(三)
  • 守护进程(精灵进程)
  • csdn冷知识:如何在csdn里输入公式或矩阵
  • 【前端】CSS技巧与样式优化
  • Linux下的系统编程——makefile入门
  • redis常用五种数据类型详解
  • Python代理池健壮性测试 - 压力测试和异常处理
  • 回文子串-中心拓展
  • 2023.8各大浏览器11家对比:Edge/Chrome/Opera/Firefox/Tor/Vivaldi/Brave,安全性,速度,体积,内存占用
  • python中的matplotlib画散点图(数据分析与可视化)
  • 2023前端面试笔记 —— HTML5
  • 【LeetCode】面试题总结 消失的数字 最小k个数
  • 导入功能importExcel (现成直接用)
  • cvc-complex-type.2.4.a: 发现了以元素 ‘base-extension‘ 开头的无效内容。应以 ‘{layoutlib}‘ 之一开头
  • cortex-A7核IIC实验