标签: pxsourcelist

动态NSOutlineView数据源

所以我实现了一个PXSourceList数据源,它几乎是Apple的NSOutlineView数据源示例的副本.

这是怎么回事......

- (NSUInteger)sourceList:(PXSourceList*)sourceList numberOfChildrenOfItem:(id)item; {
    if (item == nil) {
        // item is nil so it's part of the very top hierarchy.
        // return how many sections we need.
        return 2;
    }
    else {
        if ([item class] == [TSFileSystemItem class] ) {
            return [item numberOfChildren];
            // if item isn't nil and it's a TSFileSystemItem, then return it's children.
        }
        if ([item class] == [TSWorkspaceItem class]) {
            return 2; // i don't know, random items.
        } …
Run Code Online (Sandbox Code Playgroud)

cocoa datasource objective-c nsoutlineview pxsourcelist

5
推荐指数
1
解决办法
587
查看次数