
Untitled
By: a guest on
May 5th, 2012 | syntax:
None | size: 0.90 KB | hits: 10 | expires: Never
NSMutableArray not being filled before it needs to be loaded
- (void)loadView
{
currentMap = [[TestMap alloc] init];
[super loadView];
}
- (id)init
{
dimensions = NSMakeSize(15.0,20.0);
tileset = [[TestTileset alloc] init];
map = [NSMutableArray arrayWithCapacity:15];
for (int i = 0; i == 14; i++)
{
NSMutableArray *tempRow = [NSMutableArray arrayWithCapacity:20];
for (int j = 0; j == 19; i++)
{
NSNumber *tempID = [NSNumber numberWithInt:0];
[tempRow addObject:tempID];
}
[map addObject:tempRow];
}
return self;
}
[super loadView]
for (int i = 0; i != 15; i++)
{
NSMutableArray *tempRow = [NSMutableArray arrayWithCapacity:20];
for (int j = 0; j != 20; j++)
{
NSNumber *tempID = [NSNumber numberWithInt:0];
[tempRow addObject:tempID];
}
[map addObject:tempRow];
}