由于@class等未知类型,有什么方法可以使Xcode编译器警告静音?我在单个 .h 文件中定义了一个可以在整个应用程序中重复使用的类型:
#ifndef Apsiape_InterfaceDefinitions_h
#define Apsiape_InterfaceDefinitions_h
#define COLOR_ALERT_RED [UIColor colorWithRed:1 green:0.3 blue:0.3 alpha:1]
...
typedef enum {
BYEdgeTypeNone = 0,
BYEdgeTypeTop,
BYEdgeTypeLeft,
BYEdgeTypeBottom,
BYEdgeTypeRight
} BYEdgeType;
#endif
我的一个类BYEdgeType
在 .h 文件中使用自定义协议的类型:
#import <UIKit/UIKit.h>
@protocol BYPullScrollViewDelegate <NSObject>
- (void)pullScrollView:(UIScrollView*)pullScrollView didScrollToPage:(NSInteger)page;
- (void)pullScrollView:(UIScrollView*)pullScrollView didDetectPullingAtEdge:(BYEdgeType)edge;
@end
我希望我InterfaceDefinitions.h
的文件位于班级的 .m 文件中,但是如果我不将其导入班级的 .m 中,Xcode(当然)会抱怨它“需要一个类型”(BYEdgeType)。我怎样才能使这个警告@class-style 静音?
提前致谢