I write some code use objective-c block, but the result confused me.
@interface MyTest : NSObject
@end
@implementation MyTest
- (void)test {
NSArray *
All three of these crash for me (although I suspect the lack of a copy on the first element of array3 is probably an oversight.) A block has to be copied if you want it to outlive the scope in which it was created. Unless you specifically know that a method copies the object you pass into it, you need to copy it yourself.