• 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: Newbie -- Notification Help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie -- Notification Help


  • Subject: Re: Newbie -- Notification Help
  • From: Itrat Khan <email@hidden>
  • Date: Sun, 17 Mar 2002 14:24:55 -0500

On Saturday, March 16, 2002, at 09:40 PM, Lucas Haley wrote:

I was just wondering if anyone could point me in the right direction
-- how would one go about setting up two NSTextFields in one window,
so that as the user types into NSTextField "A", the same text appears
in NSTextField "B"? I suspect it is pretty easy, but I'm shaky on the
whole notification thing.

It is pretty easy.

In Interface Builder:
1. Connect the delegate of NSTextField "A" to your controller
2. Connect the outlets from your controller to the text fields (i.e. textFieldAOutlet)

In your controller:
1. Implement controlTextDidChange: (see NSControl documentation) as:

- (void)controlTextDidChange:(NSNotification*)aNotification
{
// test if the sender is text field A (optional)
if ([aNotification object] == self->textFieldAOutlet)
{
[[self->textFieldBOutlet cell] takeObjectValueFrom:[self->textFieldAOutlet cell]];
}
}

Regards,
Itrat.

..................................................................
Itrat Khan
Modeless Software, Inc.
http://www.modeless.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Newbie -- Notification Help (From: Lucas Haley <email@hidden>)

  • Prev by Date: Re: NSStepper strangeness
  • Next by Date: Re: Some good docs viewer?
  • Previous by thread: Re: Newbie -- Notification Help
  • Next by thread: Cocoa's Popularity
  • Index(es):
    • Date
    • Thread