0

I have a class which was the delegate for NSTextViews, for which I was interested in the textDidEndEditing: method. I now want it to also be the delegate for NSTextFields. Problem is, they both use the same method for signaling end of text editing.

I tried to "fork" my textDidEndEditing: method to deal with both NSNotifications, but it seems like the latest (NSTextFields) don't trigger any message.

Should I be looking for an inside bug, or it is a known limitation ?

- (void)textDidEndEditing:(NSNotification *)aNotification
{   if ([[aNotification object] isKindOfClass:[NSTextView class]])
    {

    }
    else if ([[aNotification object] isKindOfClass:[NSTextField class]])
    {

    }
}
Bertrand Caron
  • 2,525
  • 2
  • 22
  • 49

1 Answers1

1

Change your method and try below:-

- (void)controlTextDidEndEditing:(NSNotification *)aNotification
Hussain Shabbir
  • 14,801
  • 5
  • 40
  • 56