Forward declare a struct in Objective-C

前端 未结 3 2025
猫巷女王i
猫巷女王i 2021-01-01 21:57

I\'m creating a protocol, and one of the parameters to a method I\'m defining is a CMTime*. I would like to forward declare CMTime as opposed to in

3条回答
  •  一向
    一向 (楼主)
    2021-01-01 22:49

    If you want the files which have the forward declaration to know about the contents of the struct, they need to either import a header (it can be in multiple places) where it is defined. You can forward declare a struct if you do not need to access its properties, but that is the extent of it.

提交回复
热议问题