0
如何从指定的UITextRange
中得到UITextView
的NSAttributedString
?我似乎无法找到任何示例或文档资源。从UITextView获取NSAttributedString和UITextRange
如何从指定的UITextRange
中得到UITextView
的NSAttributedString
?我似乎无法找到任何示例或文档资源。从UITextView获取NSAttributedString和UITextRange
没关系,我发现它:
- (id)attribute:(NSString *)attributeName atIndex:(NSUInteger)index effectiveRange:(NSRangePointer)aRange
你能在评论请添加代码是如何工作的。我需要在我的textview中为不同的对象使用属性字符串:title,detailtitle和其他。 – user2545330
@ user2545330您可以参考[documentation](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/nsattributedstring_Class/Reference/Reference.html#//apple_ref/occ/) instm/NSAttributedString/attributesAtIndex:effectiveRange :)。这里有很好的解释。 –