Circular import issues in Objective C & Cocoa Touch

后端 未结 2 1766
别跟我提以往
别跟我提以往 2020-12-10 17:22

I have a view controller in Cocoa Touch that detects when the device rotates and switches between the views of the 2 view controllers it has: landscape and portrait.

2条回答
  •  失恋的感觉
    2020-12-10 17:49

    You can use forward declarations for classes and protocols in headers in most situations to avoid circular import issues, except in the case of inheritance. In FRRViewController.h, instead of importing FRRRotatingViewController.h, can you not make a forward declaration?

    @class FRRRotatingViewController;
    

提交回复
热议问题