Re: NSTextView and NSWindowController
Re: NSTextView and NSWindowController
- Subject: Re: NSTextView and NSWindowController
- From: Fritz Anderson <email@hidden>
- Date: Mon, 26 Jun 2006 16:39:38 -0500
On 24 Jun 2006, at 8:57 AM, D.K. Johnston wrote:
I made a window in IB containing NSTextField and NSTextView
objects. I subclassed NSWindowController and connected it to these
objects with IB outlets. Subsequently, I was able to write in the
NSTextField objects with the setStringValue: method, but couldn't
get anything to appear in the NSTextView object using setString:.
[immediate problem solved with bindings]
When you ran the application under the debugger, and broke in
awakeFromNib, was the IBOutlet for the NSTextView set, or was it nil?
If it was nil, did your controller class implement a KVC set accessor
(e.g. setFoo:) with the same key name as the NSTextView IBOutlet
(e.g. IBOutlet NSTextView * foo)? Don't do that.
"For each outlet that needs a connection, the NSNib object looks for
a method of the form setOutletName: in your object. If that method
exists, the NSNib object calls it, passing the target object as a
parameter." -- documentation for awakeFromNib in the NSNibAwaking
protocol.
-- F
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden