Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView and NSWindowController



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >NSTextView and NSWindowController (From: "D.K. Johnston" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.