我第二天开始使用Cocoa。我已经设置好了一个NSTextView,它的属性字符串被绑定到一个NSArrayController上(我正在使用Core Data):
controller key: selection
model key path: myString
我了解到NSTextView需要NSAttributedString,因此在尝试设置属性值时会抛出异常。
NSInvalidArgumentException', reason: 'Unacceptable type of value for attribute: property = "myString"; desired type = NSString; given type = NSConcreteAttributedString;
有什么办法可以使我的managedObject的NSString属性显示在NSTextView中吗?