You should also be able to set the textFields' delegate to the NSViewController, implement NSTextFieldDelegate within the ViewController and do something like this
- (void)controlTextDidEndEditing:(NSNotification *)aNotification{
// NSTextField * textField = [aNotification object];
NSUInteger whyEnd = [[[aNotification userInfo] objectForKey:@"NSTextMovement"] unsignedIntValue];
if(whyEnd == NSReturnTextMovement){
// Create new event here using the below routine
/*
[[self window] keyDown: [NSEvent keyEventWithType:(NSEventType)type
location:(NSPoint)location
modifierFlags:(NSUInteger)flags
timestamp:(NSTimeInterval)time
windowNumber:(NSInteger)windowNum
context:(NSGraphicsContext *)context
characters:(NSString *)characters
charactersIgnoringModifiers:(NSString *)unmodCharacters
isARepeat:(BOOL)repeatKey
keyCode:(unsigned short)code]
];
*/
}
}
Here you are essentially TRANSLATING the notification to an EVENT by creating a NEW event to pass along to the parent view
Should also be noted that this becomes the central "dispatch" return catcher for all textfields.
Here is a great link on using the NSEvent creation methods: http://advinprog.blogspot.com/2008/06/so-you-want-to-post-keyboard-event-in.html
Notice in this writeup how the simulate a key_down and a key_up!!!