• 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: Triggering a notification?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Triggering a notification?


  • Subject: Re: Triggering a notification?
  • From: Nick Zitzmann <email@hidden>
  • Date: Wed, 30 Jul 2008 15:43:49 -0600


On Jul 30, 2008, at 3:31 PM, Randall Meadows wrote:

Grrr, seems like I should know this, or at least be able to find out, but so far, no good.

What is the trick to triggering the controlTextDidChange: delegate method/notification when you set the text of a NSTextField (for instance) *programmatically*?


You can just do this manually, like this: (warning - written in Mail, untested, use at your own risk, and all that)

[someTextField setStringValue:@"Hello world"];
[[NSNotificationCenter defaultCenter] postNotificationName:NSControlTextDidChangeNotification object:someTextField userInfo:[NSDictionary dictionaryWithObject: [[someTextField window] fieldEditor:YES forObject:someTextField] forKey:@"NSFieldEditor"]];


And yes, the delegate will get the message if you do that.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

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: Triggering a notification?
      • From: Randall Meadows <email@hidden>
References: 
 >Triggering a notification? (From: Randall Meadows <email@hidden>)

  • Prev by Date: Triggering a notification?
  • Next by Date: Re: Triggering a notification?
  • Previous by thread: Triggering a notification?
  • Next by thread: Re: Triggering a notification?
  • Index(es):
    • Date
    • Thread