在静态方法中使用变量 (需要将变量在.m文件中声明未静态static 类型)

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

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

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

例子:

.m文件

#import
"InterfaceHelper.h" static UIAlertView *waitAlert; //在这个位置进行声明 @implementation InterfaceHelper
原文地址:https://www.cnblogs.com/ygm900/p/3096430.html