- Fix for loading missions descriptions
Note: Much way better is to use NSDictionary here! Must be refactored
--- a/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m Fri Aug 14 02:09:46 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m Fri Aug 14 02:10:53 2015 +0200
@@ -92,11 +92,18 @@
for (NSUInteger i = 0; i < [self.listOfMissions count]; i++) {
NSString *desc = [[self.listOfMissions objectAtIndex:i] stringByDeletingPathExtension];
for (NSString *str in descArray)
+ {
if ([str hasPrefix:desc] && [str hasSuffix:@"\""]) {
NSArray *descriptionText = [str componentsSeparatedByString:@"\""];
- [filteredArray insertObject:[descriptionText objectAtIndex:1] atIndex:i];
+ [filteredArray addObject:[descriptionText objectAtIndex:1]];
break;
}
+ }
+
+ if ([filteredArray count] == i)
+ {
+ [filteredArray addObject:@""];
+ }
}
self.listOfDescriptions = filteredArray;
[filteredArray release];