small tweak to ingamemenu class
authorkoda
Thu, 03 Nov 2011 05:15:39 +0100
changeset 6269 57523ab57218
parent 6268 d773867f93db
child 6270 0a99f73dd8dd
small tweak to ingamemenu class
project_files/HedgewarsMobile/Classes/InGameMenuViewController.h
project_files/HedgewarsMobile/Classes/InGameMenuViewController.m
--- a/project_files/HedgewarsMobile/Classes/InGameMenuViewController.h	Thu Nov 03 05:09:05 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/InGameMenuViewController.h	Thu Nov 03 05:15:39 2011 +0100
@@ -23,10 +23,9 @@
 
 
 @interface InGameMenuViewController : UITableViewController <UIActionSheetDelegate> {
-    NSArray *menuList;
+
 }
 
-@property (nonatomic,retain) NSArray *menuList;
 
 -(void) present;
 -(void) dismiss;
--- a/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m	Thu Nov 03 05:09:05 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m	Thu Nov 03 05:15:39 2011 +0100
@@ -29,41 +29,12 @@
 #define VIEW_HEIGHT 200
 
 @implementation InGameMenuViewController
-@synthesize menuList;
 
 
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
     return rotationManager(interfaceOrientation);
 }
 
--(void) didReceiveMemoryWarning {
-    self.menuList = nil;
-    [super didReceiveMemoryWarning];
-}
-
--(void) viewDidLoad {
-    NSArray *array = [[NSArray alloc] initWithObjects:
-                      NSLocalizedString(@"Show Help", @""),
-                      NSLocalizedString(@"Tag", @""),
-                      NSLocalizedString(@"End Game", @""),
-                      nil];
-    self.menuList = array;
-    [array release];
-
-    [super viewDidLoad];
-}
-
--(void) viewDidUnload {
-    self.menuList = nil;
-    MSG_DIDUNLOAD();
-    [super viewDidUnload];
-}
-
--(void) dealloc {
-    releaseAndNil(menuList);
-    [super dealloc];
-}
-
 #pragma mark -
 #pragma mark animating
 -(void) present {
@@ -103,12 +74,21 @@
 -(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     static NSString *cellIdentifier = @"CellIdentifier";
 
+    NSInteger row = [indexPath row];
+    NSString *cellTitle;
+    if (row == 0)
+        cellTitle = NSLocalizedString(@"Show Help", @"");
+    else if (row == 1)
+        cellTitle = NSLocalizedString(@"Tag", @"");
+    else
+        cellTitle = NSLocalizedString(@"End Game", @"");
+
     UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:cellIdentifier];
     if (nil == cell) {
         cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
                                        reuseIdentifier:cellIdentifier] autorelease];
     }
-    cell.textLabel.text = [self.menuList objectAtIndex:[indexPath row]];
+    cell.textLabel.text = cellTitle;
 
     if (IS_IPAD())
         cell.textLabel.textAlignment = UITextAlignmentCenter;