Consider:
typedef void (^select_block_t)(UIView *) ;
(1) @property (copy, nonatomic) select_block_t myBlockProperty ;
(2) @property (strong, nonatomic) select_block_t myBlockProperty ;
(3) @property (assign, nonatomic) select_block_t myBlockProperty ;
and:
(A) self.myBlockProperty = ^(UIView *) {NSLog(@"Hi");} ;
(B) self.myBlockProperty = [^(UIView *) {NSLog(@"Hi");} copy] ;
I am trying to understand what is the correct way to map which property declaration with which block copy semantics
I have seen examples here on S.O. that would favor[1:B]
But then I get confused by how redundant the 'copy' operation is. My limited understanding is that [1:A] should be correct, because I want the block to be copied once when I assign the property, not once at block creation and then once again at property assignment time.
[3:B] would also make sense according to my rationale. So, what am I misunderstanding?