-1

I want to store the completion block object to another block object of my following function

- (void)downloadCompletedWithompletion:(void (^)(BOOL success,id responseObject, NSError *error))completion
{
}

Can anybody suggest me the syntax of block object to store the completion

Jeff
  • 1,405
  • 3
  • 26
  • 46

1 Answers1

2

Give your block a name as:

typedef void (^ YOUR_BLOCK_NAME)(BOOL success, id responseObject, NSError * error);

And then store as any other property:

@property (nonatomic, copy, readwrite) YOUR_BLOCK_NAME block;

You can create block as:

YOUR_BLOCK_NAME block = ^(BOOL success, id responseObject, NSError * error) {};
gagarwal
  • 4,224
  • 2
  • 20
  • 27