我收到appdelegate.h的错误:“期望的标识符或{”和“Parse issue:Missing @end”。
我已经尝试了一切我能想到的解决这个问题的方法。我检查了标题和#imports。我已经将所有类都移动到一个新项目中,认为构建设置中存在错误。我甚至重新安装Xcode无济于事。这是应用程序delegate.h
#import <UIKit/UIKit.h>
#import "MainViewController.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate> {
UIWindow *window;
MainViewController *viewController;
NSMutableArray *savedBookmarksArray;
}
@property (nonatomic) IBOutlet UIWindow *window;
@property (nonatomic) IBOutlet MainViewController *viewController;
@property (nonatomic) NSMutableArray *savedBookmarksArray;
@end
引用app委托的每个类都说找不到该文件。 .m包含在编译源中。任何人都知道如何解决这个问题?
的main.m
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
MainViewController.h
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "DDWebView.h"
@class AboutTableViewController;
@interface MainViewController : UIViewController <UIActionSheetDelegate, UIAlertViewDelegate, UIWebViewDelegate, UIPopoverControllerDelegate, UIScrollViewDelegate, UIGestureRecognizerDelegate> {
}
@end
答案 0 :(得分:2)
我解决了这个问题。我在其他一个标题中导入了#import "AppDelegate"
而不是#import "AppDelegate.h"
。
感谢您的帮助! ..
答案 1 :(得分:0)
我有一个类似的问题但事实证明我偶然在.m文件中声明了@interface并且用它搞砸了。一旦我从.m文件中删除它就可以了。