Change the text of a NSTextView programmatically

前端 未结 6 586
清歌不尽
清歌不尽 2020-12-30 23:22

I can\'t find any parameter that seems to be related with the text value showed in a NSTextView. I understood that a NSTextView uses a complex stru

6条回答
  •  我在风中等你
    2020-12-31 00:06

    Objective C / Xcode 9

    [myTextView setString:@"The string"];
    self.myTextView.string = @"My String";
    

    Swift / Xcode 9

    self.myTextView.setString("MyString")
    self.myTextView.string = "My String"
    

提交回复
热议问题