PDA

View Full Version : Problem with controlTextDidChange event




David2070
Sep 21, 2009, 05:16 PM
Hi,

I'm trying to add a handler onto a form so that I can get events when the text in a control changes and then get the changed text. I just can't seem to get the changed text when the controlTextDidChange method is called.

I've got a button and on click if I call

NSString *value = [myField stringValue];

I get the correct value of an NSTextField I have on the form.

If I call the same code from within a controlTextDidChange method though, I don't get a value.

i.e. the following doesn't work.

-(void)controlTextDidChange:(NSNotification*)aNotification {
NSString *value = [myField stringValue]
}

Can anyone help me with this as I'be been trying to fix this for hours.

Cheers.



David2070
Sep 21, 2009, 05:52 PM
Phew, after many hours finally worked this out.

The outlet was set up incorrectly.

Cheers.