I’m getting errors for the appdelegate.h: “expected identifier or {” and “Parse issue: Missing @end”.
I’ve tried everything I can think of to fix this. I’ve checked the headers and #imports. I’ve moved all the classes into a new project thinking there was something wrong in the build settings. I even reinstalled Xcode to no avail. Here’s the app 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
Every class that references the app delegate said the file could not be found. The .m is included in the Compile Sources. Anyone know how to fix this?
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
I solved the issue. I had an import as
#import "AppDelegate"instead of#import "AppDelegate.h"in one of my other headers.Thanks for all your help guys!
..