swift - 为什么我收到错误“EXC_BAD_ACCESS”
问题描述
我正在尝试使用本网站的建议来调试我的自动布局,以突出显示导致约束问题的视图。但是,当我尝试使用命令更改可疑视图的颜色时
expr ((UIView *)0x7f9ea3d43410).backgroundColor = [UIColor redColor]
我得到错误
error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0xcd4200020).
The process has been returned to the state before expression evaluation.
我也得到了错误:
error: Execution was interrupted, reason: Attempted to dereference an invalid ObjC Object or send it an unrecognized selector.
The process has been returned to the state before expression evaluation.
我不确定为什么会收到此错误,因为我已确保将示例十六进制代码替换为我自己的,此错误甚至意味着什么?
我正在快速编码,我引用的网站使用objective-c,这可能是我的问题。快速代码会做同样的事情吗?我努力了:
expr ((UIView *)0x7f9ea3d43410).backgroundColor = UIColor.redColor
解决方案
我认为简短的回答是“该链接来自 2015 年,推荐的技术使用不再支持的隐藏内部符号。”
具体来说,符号是_autoLayoutTrace。那是一个私人符号,显然已被删除。
推荐阅读
- android - 生物识别 - Android PIE 上的 FingerprintManager Xamarin 表单 - 9
- .net - 如何使用绘制的内容重新绘制图片框?
- node.js - 何时在 Loopback 4 中使用 hasMany 和 belongsTo 关系?
- python - Python library for reproducible remote data access with file caching
- android-studio - 项目文件夹搞砸了
- android - 当应用程序处于打盹模式时,警报管理器触发的 Android 通知未触发
- sql - SQL查询找出视频流数的峰值
- c# - 如何从列表框中合并多个pdf文件
- c# - 如果第一行的库存不足,如何从 1 行扣除到具有相同 id 的另一行(FIFO)
- python - 如何在python中将嵌套的if和for循环放入一行