# HG changeset patch # User koda # Date 1329588439 -3600 # Node ID 01853929804253acc7f04bd3ff27e42ad8951bd1 # Parent 314929f0a3e1f3214d8c0bb54c8a341eb76e1ece oh i thought i had converted every uitableviewcontroller to uiviewcontroller+tableview; this also restores displaying statitstics after game diff -r 314929f0a3e1 -r 018539298042 project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m --- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m Sat Feb 18 11:59:59 2012 +0100 +++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m Sat Feb 18 19:07:19 2012 +0100 @@ -91,7 +91,7 @@ // engine thread *should* be done by now NSArray *stats = [[NSArray alloc] initWithArray:self.proto.statsArray copyItems:YES]; if ([HWUtils gameStatus] == gsEnded && stats != nil) { - StatsPageViewController *statsPage = [[StatsPageViewController alloc] initWithStyle:UITableViewStyleGrouped]; + StatsPageViewController *statsPage = [[StatsPageViewController alloc] init]; statsPage.statsArray = stats; statsPage.modalTransitionStyle = UIModalTransitionStyleCoverVertical; if ([statsPage respondsToSelector:@selector(setModalPresentationStyle:)]) diff -r 314929f0a3e1 -r 018539298042 project_files/HedgewarsMobile/Classes/StatsPageViewController.h --- a/project_files/HedgewarsMobile/Classes/StatsPageViewController.h Sat Feb 18 11:59:59 2012 +0100 +++ b/project_files/HedgewarsMobile/Classes/StatsPageViewController.h Sat Feb 18 19:07:19 2012 +0100 @@ -21,7 +21,7 @@ #import -@interface StatsPageViewController : UITableViewController { +@interface StatsPageViewController : UIViewController { NSArray *statsArray; } diff -r 314929f0a3e1 -r 018539298042 project_files/HedgewarsMobile/Classes/StatsPageViewController.m --- a/project_files/HedgewarsMobile/Classes/StatsPageViewController.m Sat Feb 18 11:59:59 2012 +0100 +++ b/project_files/HedgewarsMobile/Classes/StatsPageViewController.m Sat Feb 18 19:07:19 2012 +0100 @@ -30,7 +30,8 @@ } -(void) viewDidLoad { - [self.tableView setBackgroundColorForAnyTable:[UIColor clearColor]]; + UITableView *aTableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStyleGrouped]; + [aTableView setBackgroundColorForAnyTable:[UIColor clearColor]]; NSString *imgName = (IS_IPAD()) ? @"mediumBackground~ipad.png" : @"smallerBackground~iphone.png"; UIImage *img = [[UIImage alloc] initWithContentsOfFile:imgName]; @@ -41,8 +42,13 @@ [self.view insertSubview:background atIndex:0]; [background release]; - self.tableView.separatorColor = [UIColor darkYellowColor]; - self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + aTableView.separatorColor = [UIColor darkYellowColor]; + aTableView.separatorStyle = UITableViewCellSeparatorStyleNone; + aTableView.delegate = self; + aTableView.dataSource = self; + + [self.view addSubview:aTableView]; + [aTableView release]; [super viewDidLoad]; } @@ -53,7 +59,7 @@ return 3; } --(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { +-(NSInteger) tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section { if (section == 0) return 1; else if (section == 1) @@ -111,19 +117,19 @@ return cell; } --(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { +-(CGFloat) tableView:(UITableView *)aTableView heightForHeaderInSection:(NSInteger)section { return 160; } --(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { +-(UIView *)tableView:(UITableView *)aTableView viewForHeaderInSection:(NSInteger)section { if (section == 0) { - UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 160)]; + UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, aTableView.frame.size.width, 160)]; header.autoresizingMask = UIViewAutoresizingFlexibleWidth; UIImage *img = [[UIImage alloc] initWithContentsOfFile:@"smallerTitle.png"]; UIImageView *imgView = [[UIImageView alloc] initWithImage:img]; [img release]; - imgView.center = CGPointMake(self.tableView.frame.size.width/2, 160/2); + imgView.center = CGPointMake(aTableView.frame.size.width/2, 160/2); imgView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; [header addSubview:imgView]; [imgView release]; @@ -133,16 +139,16 @@ return nil; } --(CGFloat) tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { - return self.tableView.rowHeight + 30; +-(CGFloat) tableView:(UITableView *)aTableView heightForFooterInSection:(NSInteger)section { + return aTableView.rowHeight + 30; } --(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { +-(UIView *)tableView:(UITableView *)aTableView viewForFooterInSection:(NSInteger)section { if (section == 2) { - UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width * 70 / 100, self.tableView.rowHeight)]; + UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width * 70 / 100, aTableView.rowHeight)]; footer.autoresizingMask = UIViewAutoresizingFlexibleWidth; - UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 17, self.view.frame.size.width * 70 / 100, self.tableView.rowHeight)]; + UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 17, self.view.frame.size.width * 70 / 100, aTableView.rowHeight)]; button.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; [button setTitle:NSLocalizedString(@"Done",@"") forState:UIControlStateNormal]; [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];