controlTextDidChange with 2 nstextfields - call different selectors
cocoa, macos, objective-c
Solution
Given that the `NSTextField`s are `field1` and `field2`, all you have to do is check which one of them is the sender object, given along with the notification.
E.g.:
- (void)controlTextDidChange:(NSNotification *)anotif
{
if ([anotif object]==field1)
{
// field1 processing
}
else
{
// field2 processing
}
}
Problem
cocoa newbie here i have 2 nstextfields connected with controlTextDidChange. it works fine. ``` - (void)controlTextDidChange:(NSNotification *)anotif{ [self eval]; } ``` when either of the textfields change eval is called. what i want to do is check the textfield that changed and if it's the first one call eval1, if it's the second call eval2. how can i do this?