equal
deleted
inserted
replaced
37 [super viewDidLoad]; |
37 [super viewDidLoad]; |
38 |
38 |
39 NSArray *directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:FORTS_DIRECTORY() error:NULL]; |
39 NSArray *directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:FORTS_DIRECTORY() error:NULL]; |
40 NSMutableArray *filteredContents = [[NSMutableArray alloc] initWithCapacity:([directoryContents count] / IMGNUM_PER_FORT)]; |
40 NSMutableArray *filteredContents = [[NSMutableArray alloc] initWithCapacity:([directoryContents count] / IMGNUM_PER_FORT)]; |
41 // we need to remove the double entries and the L.png suffix |
41 // we need to remove the double entries and the L.png suffix |
42 for (int i = 0; i < [directoryContents count]; i++) { |
42 for (NSUInteger i = 0; i < [directoryContents count]; i++) { |
43 if (i % IMGNUM_PER_FORT == IMGNUM_PER_FORT-1) { |
43 if (i % IMGNUM_PER_FORT == IMGNUM_PER_FORT-1) { |
44 NSString *currentName = [directoryContents objectAtIndex:i]; |
44 NSString *currentName = [directoryContents objectAtIndex:i]; |
45 NSString *correctName = [currentName substringToIndex:([currentName length] - 5)]; |
45 NSString *correctName = [currentName substringToIndex:([currentName length] - 5)]; |
46 [filteredContents addObject:correctName]; |
46 [filteredContents addObject:correctName]; |
47 } |
47 } |