声明阻止typedef的前向引用?

时间:2021-09-18 20:56:47

in one header file I have something like:

在一个头文件中我有类似的东西:

typedef void (^MyBlock)(void);

I need to use that same exact reference in another header file.

我需要在另一个头文件中使用相同的精确引用。

Sure, I can #import one header file into another, or include the typedef in the global pre-compiled header, but instead is there a way to forward reference the block typedef?

当然,我可以#import一个头文件到另一个头文件,或者在全局预编译头中包含typedef,但是有没有办法转发引用块typedef?

1 个解决方案

#1


9  

Not as far as I know, I'd just put it in a shared header and include it where it is needed.

据我所知,我只是把它放在一个共享标题中,并将其包含在需要它的地方。

#1


9  

Not as far as I know, I'd just put it in a shared header and include it where it is needed.

据我所知,我只是把它放在一个共享标题中,并将其包含在需要它的地方。