I want to run a block of code only once per instance.

Can I declare dispatch_once_t predicate as a member variable instead of static variable?

From GCD Reference, it is not clear to me.

The predicate must point to a variable stored in global or static scope. The result of using a predicate with automatic or dynamic storage is undefined.

I know I can use dispatch_semaphore_t and a boolean flag to do the same thing. I'm just curious.

Edit
Report