我想將幾個屬性附加到NSAttributeString並不斷收到以下錯誤。 無法將類型NSRange的值轉換爲預期的參數類型
func strikeThroughStyle() {
let range = NSMakeRange(0, 1)
// add styles to self
self.attribute(self.string, atIndex: 0, effectiveRange: range)
}
我得到的錯誤:
Cannot convert value of type 'NSRange' (aka '_NSRange') to expected argument type 'NSRangePointer' (aka 'UnsafeMutablePointer<_NSRange>')
這可能會與http://stackoverflow.com/questions/25825301/translate-nsrangepointer-from-objective-c-to-swift – Breek