我想在一个类的.h中的静态varibale,并希望它被继承到它的子类。声明公共静态变量在目标c
@interface :UIViewController
static bool isSearchWindowOpen ; //something like this.
@end
如果我这样写:
static bool isSearchWindowOpen ;
@interface :UIViewController
@end
它工作正常,但不能由子类继承。
请提出建议。
界面声明中的冒号是什么? “继承”是什么意思?你想让变量可见吗?还是你想让每个(子)类引用它自己的变量?目前还不清楚你想要达到的目标。 –