开发者

creating objects within a block

[myArray enumerateObje开发者_开发知识库ctsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        [[myTreeNode mutableChildNodes] addObject:[NSTreeNode treeNodeWithRepresentedObject:obj]];
        //myTreeNode is an NSTreeNode
    }];

Is it ok to create objects from within a block?


Yes. It's basically OK to do anything in a block that you might do in a normal function.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜