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.
This commit is contained in:
Martin Carlberg
2018-03-06 09:09:57 +01:00
committed by GitHub
parent 511d393c78
commit 32059c376e
+5
View File
@@ -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];
}