project_files/HedgewarsMobile/Classes/StatsPageViewController.m
branchios-revival
changeset 11223 93bc68aa41d3
parent 11213 6e5fd5ea5acb
child 11231 bb3e57426a07
--- a/project_files/HedgewarsMobile/Classes/StatsPageViewController.m	Wed Oct 21 18:15:19 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/StatsPageViewController.m	Wed Oct 21 21:58:50 2015 +0200
@@ -54,6 +54,20 @@
     [super viewDidLoad];
 }
 
+#pragma mark - Helpers
+
+- (NSString *)teamNameFromInfo: (NSArray *)info
+{
+    NSString *teamName = [NSString stringWithString:[info objectAtIndex:2]];
+    
+    for (int i=3; i < [info count]; i++)
+    {
+        teamName = [teamName stringByAppendingFormat:@" %@", [info objectAtIndex:i]];
+    }
+    
+    return teamName;
+}
+
 #pragma mark -
 #pragma mark Table view data source
 -(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
@@ -93,7 +107,7 @@
                                                    green:((color >> 8) & 0xFF)/255.0f
                                                     blue:(color & 0xFF)/255.0f
                                                    alpha:1.0f];
-        cell.textLabel.text = [NSString stringWithFormat:@"%d. %@ (%@ kills)", row+1, [info objectAtIndex:2], [info objectAtIndex:1]];
+        cell.textLabel.text = [NSString stringWithFormat:@"%d. %@ (%@ kills)", row+1, [self teamNameFromInfo:info], [info objectAtIndex:1]];
         imgName = [NSString stringWithFormat:@"StatsMedal%d",row+1];
     } else if (section == 2) {  // general info
         imgName = @"iconDamage";