Errors when making circular reference imports

后端 未结 2 1738
南方客
南方客 2020-12-10 15:27

My program was running fine, but I changed something and now it has over 48 errors.

I think I know the problem, but I don\'t know how to fix it. I created a class ca

相关标签:
2条回答
  • 2020-12-10 15:52

    You can use a forward declaration in one of your header files to avoid the need to import the other header. For example, in mViewBase.h, you can say:

    @class Cakes2;
    

    Now the compiler knows that "Cakes2" refers to a class, and you don't need to import the entire Cakes2.h file.

    0 讨论(0)
  • 2020-12-10 15:53

    I think you should perhaps consider using a UITabBarController. It is made specifically for managing several view controllers from a bar at the bottom of the screen.

    0 讨论(0)
提交回复
热议问题