Mat*_*oal 20 macos cocoa objective-c nstextview
我找不到任何与a中显示的文本值相关的参数NSTextView.我知道a NSTextView使用复杂的结构(有NSLayoutManager...等),但我找不到修改当前text值的有效方法.
Mat*_*oal 25
正确的方法是"setString" [textView setString:@"the string"];
Pet*_*erg 16
在插座textView Swift Xcode 8.0上设置文本
textView.string = newString
Run Code Online (Sandbox Code Playgroud)
如果您想设置属性文本(格式化文本),请尝试
[myTextView setAttributedString:(NSAttributedString*)attrString].
Run Code Online (Sandbox Code Playgroud)
NSTextView 包含一个实际保存文本的 NSTextStorage 对象...
目标 C / Xcode 9
[myTextView setString:@"The string"];
self.myTextView.string = @"My String";
Run Code Online (Sandbox Code Playgroud)
斯威夫特/ Xcode 9
self.myTextView.setString("MyString")
self.myTextView.string = "My String"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
18743 次 |
| 最近记录: |