我正在 iPhone 应用程序中创建一个全局 int 变量,但它给出了错误。
我这样声明:
AppDelegate.h
int maxglobal;
当我将其分配给任何其他值时,它表示对象无法设置为其他类中的属性。
最佳答案
Objective-C :
@property (assign) int maxglobal; // define this in app delegate
C:
int maxglobal; // define this outside any class and it's "global"
关于iphone - 如何在 iPhone 应用程序中声明全局 int,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10731639/