我正在尝试使用一个库进行下拉。当我在项目中复制其文件时,出现奇怪的错误消息,提示未知类型名称UITableView以及很多错误,例如Expected a type。

 @protocol kDropDownListViewDelegate;
 @interface DropDownListView : UIView<UITableViewDataSource,UITableViewDelegate>
{

    UITableView *_kTableView;
    NSString *_kTitleText;
    NSArray *_kDropDownOption;
   CGFloat R,G,B,A;
   BOOL isMultipleSelection;
}
 @property(nonatomic,strong)NSMutableArray *arryData;
 @property (nonatomic, assign) id<kDropDownListViewDelegate> delegate;
- (void)fadeOut;
// The options is a NSArray, contain some NSDictionaries, the NSDictionary contain 2 keys, one is "img", another is "text".
- (id)initWithTitle:(NSString *)aTitle options:(NSArray *)aOptions xy:(CGPoint)point size:(CGSize)size isMultiple:(BOOL)isMultiple;
// If animated is YES, PopListView will be appeared with FadeIn effect.
- (void)showInView:(UIView *)aView animated:(BOOL)animated;
-(void)SetBackGroundDropDwon_R:(CGFloat)r G:(CGFloat)g B:(CGFloat)b alpha:(CGFloat)alph;
@end

@protocol kDropDownListViewDelegate <NSObject>
 - (void)DropDownListView:(DropDownListView *)dropdownListView didSelectedIndex:(NSInteger)anIndex;
 - (void)DropDownListView:(DropDownListView *)dropdownListView Datalist:(NSMutableArray*)ArryData;
 - (void)DropDownListViewDidCancel;
 @end

最佳答案

您错过了#import;大概:

#import <UIKit/UIKit.h>


这通常是前缀文件(预编译的标头)的一部分,因此有可能以某种方式被破坏。

10-06 09:54