You need to change the value of the property when the user changes the text in the NSTextField component. NSTextField is created programmatically. The property is declared in the controller as follows:
@property (nonatomic) NSString* lineName; -(void)setLineName:(NSString*)value { NSLog(@"%s", value); _lineName = value; } NSTextField is created in codes, and its stringValue property is bound to the controller property lineName.
NSTextField* textField = [[NSTextField alloc] init]; ... [self.bind:@"lineName" toObject:textField withKeyPath:@"stringValue" options:@{} ] I get the following behavior. If the user enters text into a textField , nothing happens. If textField set to stringValue programmatically (textField.stringValue = @"AAAAAAA") , then the binding is triggered - the setter of the stringValue property is stringValue .
Tell me how to handle the completion of user input in NSTextField, created programmatically?