What is the main difference between using “copies” and “strong” property qualifiers in declaring properties using block types?

Example # 1

@property (nonatomic, copy) void (^errorBlock) (NSError *); 

Example # 2

 @property (nonatomic, strong) void (^errorBlock) (NSError *); 

I know that blocks are standard variables on the stack, and by creating a copy, we "move" them to the heap.

It's all? Or not?

+2
properties automatic-ref-counting objective-c-blocks
May 7 '13 at 18:48
source share
1 answer

There should be no difference. Since the property has a block type, according to http://clang.llvm.org/docs/AutomaticReferenceCounting.html#blocks

With the exception of the save made as part of initializing the __strong parameter variable or reading the __weak variable, when these semantics cause the value of the pointer block type to be saved, it has the Block_copy effect.

+1
May 7 '13 at 10:09
source share



All Articles