Reputation: 303
This is a document-based app. I want to manipulate the underlying text view within my window. I set it up as follows:
So I also created an outlet to my document class to manipulate it.
@property (strong) IBOutlet NSTextView *textView;
Though it doesn't respond to any methods I call on it. Just to test, i want the textview to load with inserted text but the textview doesn't respond at all.
self.textView.string = @"Hello world";
What am I doing wrong?
Upvotes: 0
Views: 152
Reputation: 534950
You cannot refer to the text view initialized from the nib until the nib has loaded and the text view has been created. At that point, windowControllerDidLoadNib:
is called, and the nib objects are instantiated. Until then, the textView
outlet is nil. So I'm guessing that that's the problem.
Upvotes: 1