我使用NSOutlineView
填充NSTreeController
。树控制器管理NSMutableDictionary
数组,其属性包括:NSString *name
,and NSArray* children
。
如何在用户界面中更改name
时收到通知?
答案 0 :(得分:0)
只需将一个函数放入NSOutlineView
的委托中- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
{
// for example that is checked that node text is not empty
if ([[fieldEditor string] length] == 0)
{
return NO;
}
else
{
return YES;
}
}