objective-c - Xcode:摆脱前向类警告

标签 objective-c xcode warnings

在 Xcode 中,我声明了一个前向类以避免循环导入,例如

@class MyClass;

然后我对该类进行方法调用,例如

[MyClass myMethod];

但是我收到了前级警告,例如

warning: receiver 'MyClass' is a forward class and corresponding @interface may not exist

如何在我的整个项目中隐藏它们?

最佳答案

您在 文件中使用前向类声明来防止循环导入。

您仍然必须在 .m 文件中导入 MyClass header 。 .m 文件不存在循环导入问题。

关于objective-c - Xcode:摆脱前向类警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1916776/

相关文章:

xcode - 从我们的应用播放声音时暂停ipod,然后恢复播放

iphone - UIView动画使用90%CPU

ios - 断点在 Xcode 6.3 的 Swift 中不起作用

iphone - iOS检查对象是否可以保留

ios - 剪裁当前上下文,使其被路径掩盖

ios - 从XCode OpenGL ES调试器隐藏着色器代码

objective-c - 如何在 Objective-C 中设置文本字段的委托(delegate)?

elixir - 我们如何解决 Elixir 中的冲突行为警告

r - 警告消息 : line appears to contain embedded nulls

php - "Notice: Undefined variable"、 "Notice: Undefined index"、 "Warning: Undefined array key"和 "Notice: Undefined offset"使用 PHP