• 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: Send action when textDidChange
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Send action when textDidChange


  • Subject: Re: Send action when textDidChange
  • From: Carlos Weber <email@hidden>
  • Date: Mon, 25 Jun 2001 21:41:15 -1000

On Monday, June 25, 2001, at 06:36 , Ivan Myrvold wrote:

> My application have a search field and a table. When a user types
> something in the search field, the table should update based on the
> search value.
>
> I solved this by adding the window controller as an observer of the
> NSControlTextDidChangeNotification message. This works great. But the
> window also have two other fields, and the
> NSControlTextDidChangeNotification message is posted also when these
> fields are edited.
>
> To solve this side effect, it would be nice to have the text field send
> an action when the text in its field changes. As I have understood from
> the documentation, the default is that an action message is sent when
> the return key is pressed.
>
> So how do I change this? I read the docs for NSControl, NSActionCell
> and NSCell without finding the answer to this.

What if you just registered as an observer of the
NSControlTextDidChangeNotification message for your particular search
field? The method

- (void)addObserver:(id)anObserver
selector:(SEL)aSelector
name:(NSString *)notificationName
object:(id)anObject

allows you to specify anObject as the sole source of the notifications,
or pass nil if you want to receive the notification from all sources.

Or did I misunderstand what you are trying to accomplish?


References: 
 >Send action when textDidChange (From: Ivan Myrvold <email@hidden>)

  • Prev by Date: Re: java cocoa appkit application and multiple threads
  • Next by Date: Re: int -> NSString
  • Previous by thread: Send action when textDidChange
  • Next by thread: Re: Send action when textDidChange
  • Index(es):
    • Date
    • Thread