CocoaCoder
CocoaCoder

Reputation: 29

How do you edit an NSTextView in Interface Builder?

I am using Xcode to create a Cocoa application for Mac OS X. I have a lot of text that I want to put in an NSTextView. Unfortunately, I cannot edit the text in my NSTextView in Interface Builder; I can only edit it when the app launches.

Is there a simple way to edit the text of an NSTextView before the app launches (in Interface Builder)?

Upvotes: 1

Views: 1032

Answers (2)

Peter Hosey
Peter Hosey

Reputation: 96323

You used to be able to do this by double-clicking on the text view, and Xcode still shows the I-beam cursor when you do that, so I'd say it's a bug and you should report it.

Upvotes: 1

Matt S.
Matt S.

Reputation: 13753

Use this in viewDidLoad:

[yourView insertText:@"Your text here"];

If you want to do it in IB, change the title (I think that's what it's called) in the inspector pane.

Upvotes: 1

Related Questions