1

在我的头文件 GuiController.h 中:

#import <Cocoa/Cocoa.h>
#import <APPKit/NSTextField.h>
#import "ClientSocket.h"
#import "UploaderThread.h"
#import "DownloaderThread.h"

/**
 * SER 321 Foundations of Distributed Applications
 * see http://pooh.poly.asu.edu/Cst420
 * @author Christopher Sosa (smoothpinkjazz@gmail.com), ASU Polytechnic, Software Engineering
 * @version December 2012
*/

@class AppDelegate; //compiler error
@interface GuiController : NSObject {
    AppDelegate * appDelegate;
    NSSound *sound;
    NSString *port;
    NSString *host;
    ClientSocket *mainSock;
    ClientSocket *songSock;
    UploaderThread *uploader;
    int ident;
    NSTextField *albTB;
    NSComboBox *titCB;
    NSTextField *authTB;

}
- (id) initWithDelegate: (AppDelegate*) theDelegate
               host: (NSString*) hostName
               port: (NSString*) portNum;
- (void) dealloc;

- (void) saveLib;
- (void) restoreLib;
- (void) addMD;
- (void) removeMD;
- (void) refreshMD;
- (void) playMD;
- (void) comboBoxSelectionDidChange: (NSNotification*)notification;
- (void) debug: (NSString*) aMessage;
@end

我标记了引发错误的行,即使似乎没有错误。我 99% 确定编译器抛出错误只是因为它感觉像它。你能找出问题所在吗?

4

1 回答 1

2

检查你的DownloaderThread.h文件。最后你可能有一个错误。

或者,GuiController.h从未编译为 Obj-C 或 Obj-C++ 的源文件导入。尽管如果是这种情况(在一个导入的标头中),我会更快地出现错误。

于 2012-12-11T22:42:53.300 回答