Question

[myArray enumerateObjectsUsingBlock:^(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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top