If I have a class function which returns a block do I need to do anything in terms of memory management for the block?
typedef BOOL (^Block)(ParamType* param);
+ (Block) makeBlock: (SeedParamType* seed)
{
return ^BOOL (ParamType* param)
{
// do something with seed
return someBoolVal;
};
}
@interface SomeClass()
@property (copy, nonatomic) Block theBlock;
@end
Do I need to do anything like explicitly in terms of memory management, or will ARC deal with everything in this situation?
Thanks
With ARC, you’ll be fine with that. There is enough information there for it to know how to manage it.
Syntax is a bit wrong though, it should be: