NSLog(@"Parsing level names..."); NSMutableArray *thisEp = [[NSMutableArray alloc] init]; [thisEp addObject:@"Placeholder"]; levelNames = [[NSMutableArray alloc] init]; for (i = 0; i < 100; i++) { [thisEp removeAllObjects]; for (j = 0; j < 5; j++) { matchString = [NSString stringWithFormat:@"%02d-%d:([^#]+)#", i, j]; [thisEp addObject:[[loadedLevelNames substringsCapturedByPattern:matchString] objectAtIndex:1]]; } [levelNames addObject:thisEp]; }