swift - Binding NSPopUpButton to core data hangs Xcode build -
my environment:
- mac os x v 10.10.4
- version 6.4 (6e35b)
my project:
- mac app using swift 1.2 storyboard
a bit of background: got nstableview multiple columns hooked nsarraycontroller, in turn, hooked core data (say entity "car"). works - can load , edit column values, , save changes sqlite. of accomplished bindings via interface builder. want add new "color" column table, representing relationship entity, entity "color". each row have nspopupbutton new column; pop-up button should have values populated second nsarraycontroller linked "color" entity. thus, "color" many-to-one relationship between car , color (many cars can reference given color), , i'd values in pop-up button correspond "name" property color.
what i've done:
in storyboard (under controller scene containing car table), i've added second nsarraycontroller, "colors array controller":
1) under "attributes inspector" -> mode = entity name, entity name = color, "prepares content" checkbox selected
2) under "bindings inspector" -> parameters -> managed object context -> "bind to" checked -> selected "cars controller" -> model key path = context
in cars table (under nstablecellview), added nspopupbutton.
at point, builds , runs properly, except columns in table show "item 1" default value pop-up button (i can see other default values when expand pop-up).
now, i've tried following in futile attempt load pop-up correct values:
strategy 1:
using interface builder, selected nspopupbutton. under bindings inspector (value selection), checked "bind to" , specified colors array controller above; controller key -> arrangedobjects; model key path -> name
strategy 2:
- created iboutlet, "colorsarray", "colors array controller" in cars controller;
- using interface builder, selected nspopupbutton. under bindings inspector (value selection), checked "bind to" , specified cars controller; model key path -> colorsarray.arrangedobjects
for both of strategies above, whenever try run (or build) project, xcode hangs @ "compiling 1 of 1 storyboard files". activity monitor shows "ibtoold" process steadily consumes memory available (as kill it, xcode reports build failed).
i appreciate if shed light i'm doing wrong, or suggest alternatives achieve desired results.
i ran same issue: bind nspopupbutton
's content
binding arraycontroller
's arrangedobjects
xcode compile storyboard forever. when remove binding compile usual :(
since nspopupbutton
inside table column, i've removed array controller , i'm binding content
directly property of table column's object value.
Comments
Post a Comment