本文介绍了Receiver'ClassName'是一个前向类,相应的@interface可能不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正试图在UIPickerView.subviews中找到 UIPickerTable ...所以我循环执行 isKindOfClass:[UIPickerTable class] ....哪个有效......但是由于UIPickerTable的标题没有公开,我得到一个警告,接收者'UIPickerTable'是一个正向类,相应的@interface可能不存在'

Im currently trying to find a UIPickerTable within the UIPickerView.subviews ... so i loop through and do isKindOfClass:[UIPickerTable class] .... which works.. but because the header of UIPickerTable isn't exposed i get a warning that "receiver 'UIPickerTable' is a forward class and corresponding @interface may not exist'

为了能够编译我做@class UIPickerTable,显然它想让我#include它。

In order to even be able to compile I do @class UIPickerTable, and obviously it want's me to #include it.

我想知道是否有办法绕过这个警告。

I'm wondering if there's a way to get around seeing this warning.

TIA!

推荐答案

我认为你不能用编译器选项来抑制那个警告。你可以通过简单地为类创建自己的头文件来消除它,包含:

I don't think that you can suppress that warning with a compiler option. You could make it go away by simply creating your own header file for the class, containing:

@interface FacesViewController : NSObject {
}

我认为不用说你的申请表了结束UIKit类的内部结构可能不是最好的策略。据推测,你有充分的理由在UIPicker里面捣乱......

I suppose it goes without saying that having your application depend on the internal structure of a UIKit class is probably not the best strategy. Presumably you have a good reason for mucking about inside the UIPicker...

这篇关于Receiver'ClassName'是一个前向类,相应的@interface可能不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 11:17