2014-07-21 110 views
0

我不知道爲什麼我得到這個錯誤,我已經在文件中導入了AppDelegate.h ..這裏是代碼在文件中這是在main.m.「使用未聲明的標識符'AppDelegate'

#import <UIKit/UIKit.h> 

#import "AppDelegate.h" 

int main(int argc, char * argv[]) 
{ 
    @autoreleasepool { 
     return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 
    } 
} 

這裏是我的AppDelegate.h

#import <UIKit/UIKit.h> 

@interface AppDelegate : UIResponder <NSURLSessionDelegate, NSURLSessionDownloadDelegate> 
@property (strong, nonatomic) UIWindow *window; 

@end 
+0

檢查文件AppDelegate.m的拼寫以及代碼行中使用的拼寫UIApplicationMain(argc,argv,nil,NSStringFromClass([AppDelegate class])); –

+1

請添加AppDelegate.h – KIDdAe

+0

@KIDdAe你去先生 – Xarotic

回答

0

AppDelegate類聲明不匹配正確AppDelegate接口

替換此行:

@interface AppDelegate : UIResponder <NSURLSessionDelegate, NSURLSessionDownloadDelegate> 

這一行:

@interface AppDelegate : NSObject<UIApplicationDelegate> 

然後,你就必須實現UIApplicationDelegate

聲明的方法看看在documentation

當您使用創建項目Xcode,所有這些都會生成。