Problem with controlTextDidChange event

Discussion in 'Mac Programming' started by David2070, Sep 21, 2009.

  1. David2070 macrumors member

    Joined:
    May 14, 2008
    Location:
    UK
    #1
    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.
     
  2. David2070 thread starter macrumors member

    Joined:
    May 14, 2008
    Location:
    UK
    #2
    Phew, after many hours finally worked this out.

    The outlet was set up incorrectly.

    Cheers.
     

Share This Page