• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: From NSTextView to address an NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: From NSTextView to address an NSTextField


  • Subject: Re: From NSTextView to address an NSTextField
  • From: Alastair Houghton <email@hidden>
  • Date: Mon, 3 Aug 2009 09:43:42 +0100

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 (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: From NSTextView to address an NSTextField
      • From: Ross Carter <email@hidden>
References: 
 >From NSTextView to address an NSTextField (From: Steve Cronin <email@hidden>)

  • Prev by Date: Re: Design Paterns: +/- Initializers and Subclassing (Solved)
  • Next by Date: [IB] - can't assign keyboard shortcut to a menu item
  • Previous by thread: Re: From NSTextView to address an NSTextField
  • Next by thread: Re: From NSTextView to address an NSTextField
  • Index(es):
    • Date
    • Thread