0
苹果文档阅读的UITextView,我读到这对textStorage财产为什么我可以通过textstograge属性编辑UITextView内容(如果是只读的)?
The text storage object holding the text displayed in this text view. (read-only)
Declaration
OBJECTIVE-C
@property(nonatomic, readonly, strong) NSTextStorage *textStorage
但在我教授的笔记
[self.body.textStorage
setAttributes:@{NSForegroundColorAttributeName : sender.backgroundColor}
range:self.body.selectedRange];
它是如何textStorage可能的编辑属性,如果是只读的?
因此,指针(内存地址)的值不能改变。在你看来,为什么指针是只读是很重要的? – ndPPPhz
这意味着UITextView内部可以假定textStorage是给定的子类。 – Mats
呃...很抱歉,但我不明白...:/ – ndPPPhz