Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 24th, 2012  |  syntax: None  |  size: 0.41 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to declare a global int in iPhone app
  2. AppDelegate.h
  3.  
  4.  int maxglobal;
  5.        
  6. @property (assign) int maxglobal; // define this in app delegate
  7.        
  8. int maxglobal; // define this outside any class and it's "global"
  9.        
  10. AppDelegate.h:
  11. @interface AppDelegate{
  12.     int maxglobal;
  13. }
  14. @property (nonatomic, readonly) int maxglobal;
  15.  
  16. AppDelegate.m
  17. @implementation AppDelegate
  18. @synthesize maxglobal;
  19.        
  20. extern int maxglobal;