From 32059c376e162f3e3ca2aad08daf8439bbd7a803 Mon Sep 17 00:00:00 2001 From: Martin Carlberg Date: Tue, 6 Mar 2018 09:09:57 +0100 Subject: [PATCH] Fixed: Nib2Cib will replace a CPTextFieldCell with a CPTextField as Cappuccino does not use cells. When a binding or connection is made to a CPTextFieldCell the binding / connection will get lost when read as the cell is never stored in the cib file. (#2572) This fix make sure that the binding / connection is made to the CPTextField instead of the cell by replacing the cell with the text field when reading the xib file. The same mechanism is used in NSButton and NSMatrix. This fix allows view based TableView bindings from a text field cell to the table cell view in the Interface Builder in Xcode. --- Tools/nib2cib/NSTextField.j | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tools/nib2cib/NSTextField.j b/Tools/nib2cib/NSTextField.j index cb0fa306b..ddbf69b48 100644 --- a/Tools/nib2cib/NSTextField.j +++ b/Tools/nib2cib/NSTextField.j @@ -26,6 +26,7 @@ @import "NSCell.j" @import "NSControl.j" +@global NIB_CONNECTION_EQUIVALENCY_TABLE @implementation CPTextField (NSCoding) @@ -82,6 +83,10 @@ if (self) { var cell = [aCoder decodeObjectForKey:@"NSCell"]; + + // If we have bindings/connections connected to the text field cell make sure they are replaced + NIB_CONNECTION_EQUIVALENCY_TABLE[[cell UID]] = self; + [self NS_initWithCell:cell]; [self _adjustNib2CibSize]; }