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

Untitled

By: a guest on Jul 17th, 2012  |  syntax: None  |  size: 0.43 KB  |  hits: 13  |  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. Setting a default value other than 0 for a property
  2. @property(nonatomic) int stackTop;
  3.        
  4. @sythesize stackTop = _stackTop;
  5.  
  6. -(void)setStackTop:(int)stackTop
  7. {
  8.     _stackTop = -1;
  9. }
  10.        
  11. -(id)init {
  12.     if (self = [super init]) {
  13.         _stackTop = -1;
  14.     }
  15. }
  16.        
  17. -(id)init {
  18.     if (self = [super init]) {
  19.         _stackTop = -1;
  20.     }
  21. }
  22.        
  23. -(id)init
  24. {
  25.  self = [super init];
  26.  if(self)
  27.  {
  28.    _stackTop = -1;
  29.  }
  30. }
  31.        
  32. self.stackTop = -1;