因此,当我输入类的名称时cue
,它会在 XCode 中显示为关于编写内容的建议,当我导入标头时也会发生同样的事情(XCode 建议我在输入时导入标头)所以文件地址肯定是对的。然而它给了我一个错误,我输入的类型不存在,或者在方法中它告诉我我需要一个类型名称。
类接口:
#import <Foundation/Foundation.h>
#import "CueTableCell.h"
#import "CueList.h"
typedef enum {
none,
immediate,
after,
afterWait,
} CueType;
@interface Cue : NSObject
@property CueType cueType;
@property NSString* title;
@property float wait;
@property (strong, nonatomic) Cue* nextCue;
@property CueTableCell* cell;
@property CueList* list;
-(id) initWithTitle: (NSString*) title cueType: (CueType) type list: (CueList*) list cell: (CueTableCell*) cell wait: (float) wait thenCall: (Cue*) nextCue ;
-(void) fire; //Should not be async.
-(void) reset; //Pauses and resets everything
-(void) callNext;
-(void) selected;
-(void) select;
@end
无法识别 Cue.h 文件的 CueTableCell 文件:
#import "Cue.h"
@interface CueTableCell : UITableViewCell
-(void) updateBarAt: (float) playHead;
-(void) updateBarIncrease: (float) by;
- (void)setTitle:(NSString *)title wait: (float) wait fadeOut: (float) fadeOut fadeIn: (float) fadeIn playFor: (float) playFor;
@property (nonatomic, weak) IBOutlet UILabel* titleLabel;
@property (nonatomic, weak) IBOutlet UILabel* waitLabel;
@property (nonatomic, weak) IBOutlet UILabel* fadeInLabel;
@property (nonatomic, weak) IBOutlet UILabel* fadeOutLabel;
@property (nonatomic, weak) IBOutlet UILabel* playForLabel;
@property (nonatomic, strong) NSString* title;
@property (nonatomic) float wait;
@property (nonatomic) float fadeIn;
@property (nonatomic) float fadeOut;
@property (nonatomic) float playFor;
@property (nonatomic, weak) Cue* cue; # <---- Get an error that Cue is not a type
@end
For some reason, the compiler recognizes Cue importing CueTableCell, but not the other way around. Cue is at the top of a class hierarchy, so other files clearly are able to import it. I've tried changing the group and file location of CueTableCell, and nothing helps.