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

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.90 KB  |  hits: 10  |  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. NSMutableArray not being filled before it needs to be loaded
  2. - (void)loadView
  3. {
  4.     currentMap = [[TestMap alloc] init];
  5.     [super loadView];
  6. }
  7.        
  8. - (id)init
  9. {
  10.     dimensions = NSMakeSize(15.0,20.0);
  11.     tileset = [[TestTileset alloc] init];
  12.     map = [NSMutableArray arrayWithCapacity:15];
  13.     for (int i = 0; i == 14; i++)
  14.     {
  15.         NSMutableArray *tempRow = [NSMutableArray arrayWithCapacity:20];
  16.         for (int j = 0; j == 19; i++)
  17.         {
  18.             NSNumber *tempID = [NSNumber numberWithInt:0];
  19.             [tempRow addObject:tempID];
  20.         }
  21.         [map addObject:tempRow];
  22.     }
  23.     return self;
  24. }
  25.        
  26. [super loadView]
  27.        
  28. for (int i = 0; i != 15; i++)
  29. {
  30.     NSMutableArray *tempRow = [NSMutableArray arrayWithCapacity:20];
  31.     for (int j = 0; j != 20; j++)
  32.     {
  33.         NSNumber *tempID = [NSNumber numberWithInt:0];
  34.         [tempRow addObject:tempID];
  35.     }
  36.     [map addObject:tempRow];
  37. }