Comments (5)
OK, 已经复现了, 但是目前我不知道该如何解决, 是Xcode Optimization Level 导致的类型转换失败.
唯一能想到的是可以通过将Optimization Level 设置为none 来避免crash.
from attributedstring.
目前先使用强转规避了崩溃问题😂
get {
if let temp = objc_getAssociatedObject(self, &UILabelActionsKey) {
return temp as! [NSRange: Action]
} else {
return [:]
}
}
from attributedstring.
???? as! 可以规避吗? 类型应该是 [NSRange: [Action]] 不是 [NSRange: Action]
from attributedstring.
强转成需要的返回类型就可以了
from attributedstring.
https://github.com/lixiang1994/AttributedString/releases/tag/3.3.4
as?
在 Xcode14 iOS12 Release Mode 下运行会导致类型转换出现null 导致crash.
已改为as!
绕过这个问题 后续等待苹果解决这个编译优化问题吧
from attributedstring.
Related Issues (20)
- Error HOT 2
- 重构Action没有兼容低版本吗?我代码之前都可以跳转,升级后点击事件没了 HOT 5
- 自定义构造 Attribute HOT 6
- 控制器的某个Label属性使用了.action 造成该控制器没有调用deinit HOT 16
- ASAttributedString如何通过range截取部分富文本? HOT 10
- ViewAttachment 能否将view开放出来 HOT 4
- 添加Action的情况下 文字颜色始终是蓝色,怎么修改呢 HOT 2
- AttributedString.swift文件中别名的问题 HOT 1
- TextView 图片偏移显示不全 HOT 2
- 挺喜欢这个库,但是使用的时候遇到了一些问题 HOT 15
- UIButton下action点击无效 HOT 1
- 点击事件崩溃 HOT 3
- iOS16 UITextView 默认使用的TextKit2 如遇到问题 可以切换到 TextKit 1
- 如何在SwiftUI中使用? HOT 1
- 根据多个Range设置字体颜色时,只有最后一个生效 HOT 3
- Build error with Objective-C project HOT 1
- How to create from HTML? HOT 1
- UITextView 如果设置了 isSelectable = false HOT 1
- Crash at Action.swift HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from attributedstring.