Xcode: get rid of front class warning

In Xcode, I have a forward-declared class to avoid circular import, for example.

@class MyClass;

And then I call the method call in this class, for example.

[MyClass myMethod];

But I get a front class warning, for example.

warning: MyClass receiver is a front class and the corresponding @interface may not exist

How can I hide them throughout the project?

+5
source share
2 answers

You use direct class declarations in your header file to prevent circular import.

You must import the MyClass header into your .m file. The circular import problem does not exist with .m files.

+24
source

.

:

@class , #import .m.

+3

All Articles