2

我一整天都没有碰过 AppDelegate.h 文件,突然我收到 3 个错误...

//  AppDelegate.h

#import <UIKit/UIKit.h>  //!Expected selector for Objective-C method
                         //!Expected method body

@class ViewController;

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@property (strong, nonatomic) ViewController *viewController;  //!Unknown type name "ViewController" did you mean "UIViewController?

@end

我把上面代码中的错误作为注释。

我看到其他人过去也有类似的错误,但我没有看到对我的情况有意义的答案。

我的根 UIViewController 被命名为 ViewController。我做了什么导致这些错误突然出现?我今天所做的只是添加一个新的 ViewControler 和 xib 以在 UIPopoverController 中使用。我刚刚让弹出框正常工作,这开始发生了。

约翰

4

1 回答 1

2

您在作为#import该头文件的源文件的行中引入了语法错误。

于 2013-03-04T00:24:06.793 回答