I’m trying to bind a label (NSTextField) to a class’ property. In Interface Builder I bind the label’s Value to File’s Owner with Model Key Path = self.aString.
-
File’s Owner is a NSViewController’s subclass with aString defined as:
@property (nonatomic, strong) NSString *aString; -
The label is placed inside a View Based NSTableView filled at run-time by a binding with a managed object context.
When i call [self setAString:@"..."] or [self setValue:@"..." forKey:@"aString"] in the class’ implementation, nothing changes in the table view. However if the label is placed inside the view it works. Why?
I solved by subclassing NSTableCellView and adding to it a NSString property. Then i bound the value of the label to the Table Cell View with the name of the property as key.