Ios &引用;使用未声明的标识符';AppDelegate';

Ios &引用;使用未声明的标识符';AppDelegate';,ios,objective-c,appdelegate,Ios,Objective C,Appdelegate,我不确定为什么会出现此错误,我已在文件中导入了AppDelegate.h。。这是文件中的代码。这是主要的 #import <UIKit/UIKit.h> #import "AppDelegate.h" int main(int argc, char * argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate c

我不确定为什么会出现此错误,我已在文件中导入了AppDelegate.h。。这是文件中的代码。这是主要的

#import <UIKit/UIKit.h>

#import "AppDelegate.h"

int main(int argc, char * argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}
#导入
#导入“AppDelegate.h”
int main(int argc,char*argv[])
{
@自动释放池{
返回UIApplicationMain(argc、argv、nil、NSStringFromClass([AppDelegate类]);
}
}
这是我的AppDelegate.h

#import <UIKit/UIKit.h>

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

@end
#导入
@接口AppDelegate:UIResponder
@属性(强,非原子)UIWindow*window;
@结束

您的
AppDelegate
类声明与正确的
AppDelegate
接口不匹配

替换此行:

@interface AppDelegate : UIResponder  <NSURLSessionDelegate, NSURLSessionDownloadDelegate>
@interface AppDelegate : NSObject<UIApplicationDelegate>
@接口AppDelegate:UIResponder
这一行:

@interface AppDelegate : UIResponder  <NSURLSessionDelegate, NSURLSessionDownloadDelegate>
@interface AppDelegate : NSObject<UIApplicationDelegate>
@接口AppDelegate:NSObject
然后,您必须实现在
uiapplicationelegate

看一看


使用Xcode创建项目时,将生成所有这些内容。

检查文件AppDelegate.m的拼写以及代码行UIApplicationMain中使用的拼写(argc、argv、nil、NSStringFromClass([AppDelegate class]);请添加AppDelegate。h@KIDdAe好了,先生,你有
AppDelegate
课程吗?@KudoCC如果有助于你理解我的来历,我将严格遵循本教程。