0
let initialStr = "To see information for today, please"
let tempFontSize = UIUtils.getFontForApproprieteField(.subHeadline).font.pointSize
let tealDict = [NSAttributedStringKey.font: UIFont.systemFont(ofSize: tempFontSize), NSAttributedStringKey.foregroundColor: UIColor.LTColor()]
let linkAttributes = [NSAttributedStringKey.foregroundColor: UIColor.LTColor(), NSAttributedStringKey.underlineStyle: NSNumber(value: false as Bool)]
errorLbl?.linkAttributes = linkAttributes
errorLbl?.delegate = self
let attributedString = NSMutableAttributedString(string: AppMessage.emptyWidget, attributes: [NSAttributedStringKey.font: UIFont.systemFont(ofSize: tempFontSize)])
attributedString.addAttributes(tealDict, range: NSMakeRange(initialStr.length+1,3))
errorLbl?.attributedText = attributedString
let rangeT : NSRange = (AppMessage.emptyWidget as NSString).range(of: " add")
errorLbl?.addLink(to: URL(string: "https://www.google.co.in/")!, with: rangeT)
私はは、ハイパーリンクとしてください後でを追加したいです。この行を言語を変更したときを除いて、すべてのデバイスで動作しているため、クラッシュします。iPhoneの言語をクラッシュの原因に変更したときは?
iphoneの言語を変更してこの行をクラッシュさせたときは?
languageChange: - 英語 - >ヒンディー語
クラッシュ:
がキャッチされない例外により 'NSRangeException' にアプリを終了、理由: 'NSMutableRLEArray objectAtIndex:effectiveRange ::境界外' という
これは、渡す範囲が正しくないことを意味します。あなたはそれをデバッグする必要があります。 –
がデバッグされました。 nslocalised文字列キーにはなぜ腐食性の値がありませんでした。 – Amey