Fogmeister
Fogmeister

Reputation: 77661

Define a block in a class to use elsewhere

Im trying to define a block type in a class so that I can then use it in other classes.

I've put this in the .h of a class that is used everywhere...

typedef void (^ProgressBlock)(float progress);

but I'd now like to use this block in other places.

I have a class that imports the correct .h file but the ProgressBlock is not available. Is there any way to define the block so I can use it in multiple classes?

Upvotes: 2

Views: 131

Answers (1)

sbarow
sbarow

Reputation: 2819

Make a constants file (C and C++ Header file) define you block in there. Import that file where ever you want to use the block.

Upvotes: 1

Related Questions