Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 4.2:[Swift.\u EmptyArray存储库\u getValue:forType:]:无法识别的选择器_Swift_Nsmutableattributedstring_Swift4.2 - Fatal编程技术网

Swift 4.2:[Swift.\u EmptyArray存储库\u getValue:forType:]:无法识别的选择器

Swift 4.2:[Swift.\u EmptyArray存储库\u getValue:forType:]:无法识别的选择器,swift,nsmutableattributedstring,swift4.2,Swift,Nsmutableattributedstring,Swift4.2,在将项目升级到Swift 4.2(从4.0转换)之后,我面临一个NSInvalidArgumentException异常 我刚刚发现了代码中的错误 因此,由于编译器错误“'none'不可用:使用[]构造一个空选项集”,我将NSUnderlineStyle.none.rawValue替换为[]尝试将.rawValue添加到您的下属样式谢谢,为我节省了大量工作。尤其是因为崩溃消息不是很有用。。 2018-09-19 15:37:33.253482+0100 <redacted>-beta

在将项目升级到Swift 4.2(从4.0转换)之后,我面临一个
NSInvalidArgumentException
异常


我刚刚发现了代码中的错误


因此,由于编译器错误“'none'不可用:使用[]构造一个空选项集”,我将
NSUnderlineStyle.none.rawValue
替换为
[]
尝试将
.rawValue
添加到您的下属样式谢谢,为我节省了大量工作。尤其是因为崩溃消息不是很有用。。
2018-09-19 15:37:33.253482+0100 <redacted>-beta[3715:1010421] -[Swift._EmptyArrayStorage _getValue:forType:]: unrecognized selector sent to instance 0x107e6c290
2018-09-19 15:37:33.254312+0100 <redacted>-beta[3715:1010421] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Swift._EmptyArrayStorage _getValue:forType:]: unrecognized selector sent to instance 0x107e6c290'
mutableAttributedString.addAttribute(NSAttributedString.Key.underlineStyle, value: NSUnderlineStyle.none.rawValue, range: range)
                                                                                   ^~~~~ 'none' is unavailable: use [] to construct an empty option set