【发布时间】:2021-11-26 01:18:00
【问题描述】:
这是我的代码:
let textRange = UETextRange(charIndex: i, length: l - i)
for j in textRange.charIndex...getCharIndexAfterEndOfRange(range: textRange) {
if String(initialText[j - 1]) == "\n" { //error here
hits += 1
let hitIndex = attributeRange.index + (hits - 1)
if hitIndex <= paragraphStyles.count {
let charIndex = paragraphStyles[hitIndex].charIndex
}
}
}
我该如何解决这个错误?
【问题讨论】: