参考:http://blog.csdn.net/wbw1985/article/details/7874688     IOS开发之---static变量

在静态方法中使用变量,需要将变量声明为static 类型。

而且,声明的位置不是在.h文件中,而是.m文件中。

例子:

.m文件

#import
"InterfaceHelper.h" static UIAlertView *waitAlert; //在这个位置进行声明 @implementation InterfaceHelper

 

 

 

 

 

相关文章:

  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
  • 2021-09-14
  • 2021-08-18
  • 2021-12-12
  • 2022-12-23
猜你喜欢
  • 2021-11-19
  • 2021-09-07
  • 2022-12-23
  • 2021-11-19
相关资源
相似解决方案