2010-08-11 72 views
0

如何同步兩個界面元素並在終止時保存值?我連接了一個複選框'狀態和一個文本字段的啓用到NSObjectController。 「內容」插座也連接到複選框。 (不知道爲什麼?)。它的工作原理與NSObjectController但每當我綁定值的一個NSUserDefaultsController,我的應用程序崩潰,在啓動與此錯誤:NSUserDefaults&bindings

An uncaught exception was raised [ addObserver: forKeyPath:@"selection.enabled" options:0x0 context:0x0] was sent to an object that is not KVC-compliant for the "selection" property. *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ addObserver: forKeyPath:@"selection.enabled" options:0x0 context:0x0] was sent to an object that is not KVC-compliant for the "selection" property.'

回答

1

selection來自NSObjectController和NSUserDefaultsController是不是一種NSObjectController的。您需要通過values進行綁定。