1
我有一个NSOutlineView
使用NSTreeController
填充。树控制器管理一系列NSMutableDictionary
,其属性包括:NSString *name
,and NSArray* children
。如何观察使用NSTreeController和NSOutlineView编辑项目
name
在用户界面中发生了变化时如何获得通知?
我有一个NSOutlineView
使用NSTreeController
填充。树控制器管理一系列NSMutableDictionary
,其属性包括:NSString *name
,and NSArray* children
。如何观察使用NSTreeController和NSOutlineView编辑项目
name
在用户界面中发生了变化时如何获得通知?
只是把一个函数变成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;
}
}
的代表