Robert Altman
Robert Altman

Reputation: 5505

Syntax for Objective-C property of block-type (without typedef)

The syntax for declaring a property referring to a block is:

typedef void (^voidBlock)();
@property (nonatomic, copy) voidBlock callback;
...
@synthesize callback;

How could this be done without the typedef?

Upvotes: 9

Views: 2459

Answers (1)

David V
David V

Reputation: 11699

@property (nonatomic, copy) void (^callback)();

Upvotes: 21

Related Questions