在NSTreeviewController中添加对象和子对象

时间:2014-04-08 06:54:34

标签: macos treeview nsoutlineview nstreecontroller

我在NSTreeviewController类中奋斗了2天。这是我的代码

    NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                            [NSNumber numberWithBool:YES], @"isGroup",
                            @"Desktop",@"name",
                            [NSMutableArray arrayWithObjects:
                             [NSDictionary dictionaryWithObjectsAndKeys:@"Science", @"name",nil],
                             [NSDictionary dictionaryWithObjectsAndKeys:@"Art", @"name", nil],
                             [NSDictionary dictionaryWithObjectsAndKeys:@"History", @"name", nil],nil], @"children", nil];

[treecontroller addObject:dic];

我已将TreeController Keypaths添加为' children'。

实际上我的应用范围是要显示文件目录。如下所示

我附上了图片NSTreeview

我想在这里显示取景器。

我怎么能在这里添加。请帮助。我在等。提前致谢。抱歉我的错误英语

0 个答案:

没有答案
相关问题