On 2 Aug 2009, at 21:48, Steve Cronin wrote:

Folks;

NSTextView <- NSText <- NSView <- NSReponder <- NSObject

                NSTextField <- NSView <- NSReponder <- NSObject

At runtime if I have access to an instance of NSTextView how can I address the NSTextField?
I know I should know this but I having a 'moment'...

In addition to what Kyle said, the confusion probably arises because NSTextField uses the field editor, so it is possible to receive notifications relating to the field editor in which case you might not know which text field it was about.

Usually this means you're watching the wrong notification. The inheritance diagram for NSTextField above is wrong; it should look like this:

  NSTextField <- NSControl <- NSView <- NSResponder <- NSObject

and the important part here is NSControl. NSControl sends a number of notifications that mirror those sent by NSText(View), and if you're finding that you're getting a notification that doesn't tell you which NSTextField (or other editable control) you're dealing with, it's probably just that you're somehow listening to the NSText(View) notifications rather than the NSControl ones.

Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to