我認爲這很簡單,但在2天后我承認失敗。 任務很簡單:
在用戶界面中,顯示&從包含在myClass中的NSMutableDictionary中的鍵/值對編輯單個NSString值。在Interface Builder中訪問NSMutableDictionary值
這裏是代碼提取物:
myClass:
NSMutableDictionary *settings;
settings = [[NSMutableDictionary alloc] init];
[settings setObject:@"2400" forKey:@"test"];
在IB:
- 文件的所有者類= myClass的
- NSDictionaryController內容字典勢必文件的所有者型號關鍵路徑 '設置'
- 勢必DictionaryController arrangedObjects的NSTextField型號關鍵路徑 '測試'
產生錯誤: [<_NSControllerKeyValuePair 0x1001db3d0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key test.
任何意見和幫助,非常感謝。
對不起,初始化完成了,我只是忘了把它包含在上面的代碼中。 – helioz 2013-02-21 10:04:49