Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > NSTextField delegate notification question

NSTextField delegate notification question
Thread Tools
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
Feb 27, 2003, 01:01 PM
 
I have a few different NSTextFields with different tags wired up to a delegate in Interface Builder. My delegate over-rides controlTextDidChange:(NSNotification *)noif

When my controlTextDidChange gets called, how do I get the tag of the text field which posted the notification?

Based on the tag, I want to call different methods from with controlTextDidChange.

I can get the nofications userInfo dictionary, but this returns an NSTextView, not my NSTextField.

Any suggestions?
     
Senior User
Join Date: Dec 2001
Status: Offline
Reply With Quote
Feb 27, 2003, 01:38 PM
 
int tag = [[notification object] tag];

I think that's it. The notification's userInfo dictionary is for (optional) extra information about the notification, whereas the notification's object is always the object that actually posted the notification.
"Think Different. Like The Rest Of Us."

iBook G4/1.2GHz | 1.25GB | 60GB | Mac OS X 10.4.2
Athlon XP 2500+/1.83GHz | 1GB PC3200 | 120GB | Windows XP
     
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
Feb 27, 2003, 11:20 PM
 
Thanks! That did the trick.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:50 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2