【发布时间】:2014-09-10 05:56:02
【问题描述】:
以下是我的 AppDelegate.h 文件:
#import <UIKit/UIKit.h>
@class ViewController;
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) ViewController *viewController;
@end
以下是一个名为 ViewControllerTEST.h 的文件,其中包含 AppDelegate.h 使用的 ViewController 接口的声明:
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
我的问题:
当 AppDelegate.h 中的“@class ViewController”行运行时,编译器如何知道在哪里可以找到 ViewController 接口的声明?换句话说,编译器在执行 AppDelegate.h 中的“@class ViewController”行时,如何知道 ViewController 类的接口是在 ViewControllerTEST.h 中定义的?
【问题讨论】:
标签: ios objective-c iphone uiviewcontroller appdelegate