When does the NSBlock get freed?

118 Views Asked by At

In a view controller I have a property of NSBlock of copy type as follow

@interface myViewController
@property(nonatomic, copy) MyBlock *block;
@end

@implementation myViewController

@end

When my application pop from myViewController then my block will be release automatically?

Note: My project is ARC enabled.

1

There are 1 best solutions below

4
On BEST ANSWER

The block is deallocated when the view controller is deallocated. Whether the view controller is deallocated on pop or not depends on your app.

Anyway, dealloc on the view controller -> destruction of the block. Unless you've shared the block pointer with other objects in your view controller code, of course.