1
類
在我的頭文件GuiController.h前:Objective-C的問題 - 期望標識符或「(」
#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 ([email protected]), 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%肯定,只是因爲感覺它的編譯器引發錯誤。你能找出問題?
.m文件的外觀如何? –
嘗試導入AppDelegate.h? –
@PeterWarbo使用'@ class'的目的是避免導入.h文件。 – rmaddy