【发布时间】:2011-07-08 16:03:12
【问题描述】:
我正在编写一个多视图应用程序,它利用一个名为 RootViewController 的类在视图之间切换。
在我的MyAppDelegate 标头中,我创建了一个名为rootViewController 的RootViewController 实例。我见过这样的例子,其中@class 指令被用作“前向类声明”,但我不太确定这意味着什么或完成了什么。
#import <UIKit/UIKit.h>
@class RootViewController;
@interface MyAppDelegate
.
.
.
【问题讨论】:
-
我的猜测是你没有“创建一个实例”,而是“声明一个指向的指针”。这是正确的吗?
标签: objective-c c-preprocessor forward-declaration