Reputation: 93
I keep seeing block declarations like this:
typedef returnType (^TypeName)(parameterTypes);
And I would like to know, why would I declare a block as a typedef?
Upvotes: 3
Views: 662
Reputation: 2369
You do it that way to reduce the likelihood of typos and make the code more readable. For an extreme example, see my answer here: Syntax to define a Block that takes a Block and returns a Block in Objective-C
Upvotes: 1