project_files/HedgewarsMobile/Classes/SupportViewController.m
branchios-develop
changeset 12877 00215a7ec5f5
parent 11554 893722a2a1f9
child 13171 ba5c794adae3
--- a/project_files/HedgewarsMobile/Classes/SupportViewController.m	Fri Dec 29 22:37:31 2017 +0100
+++ b/project_files/HedgewarsMobile/Classes/SupportViewController.m	Sat Dec 30 01:22:11 2017 +0100
@@ -23,13 +23,13 @@
 @implementation SupportViewController
 @synthesize waysToSupport;
 
--(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
     return rotationManager(interfaceOrientation);
 }
 
 #pragma mark -
 #pragma mark View lifecycle
--(void) viewDidLoad {
+- (void)viewDidLoad {
     [super viewDidLoad];
 
     NSArray *array = [[NSArray alloc] initWithObjects:
@@ -40,7 +40,6 @@
                       NSLocalizedString(@"Chat with the devs in IRC",@""),
                       nil];
     self.waysToSupport = array;
-    [array release];
 
     self.navigationItem.title = @"♥";
     self.tableView.rowHeight = 50;
@@ -67,7 +66,7 @@
 
     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
     if (cell == nil)
-        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
+        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
 
     NSString *rowString = [self.waysToSupport objectAtIndex:(row + section)];
     cell.textLabel.text = rowString;
@@ -100,21 +99,18 @@
 
     NSString *imgString = [[NSString alloc] initWithFormat:@"%@/%@.png",[[NSBundle mainBundle] resourcePath],imgName];
     UIImage *img = [[UIImage alloc] initWithContentsOfFile:imgString];
-    [imgString release];
     cell.imageView.image = img;
     if (section == 0) {
         UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
         cell.accessoryView = imgView;
-        [imgView release];
     }
-    [img release];
 
     return cell;
 }
 
 #pragma mark -
 #pragma mark Table view delegate
--(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
 {
     if ([indexPath section] == 0)
     {
@@ -145,18 +141,16 @@
     }
 }
 
--(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger) section {
+-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
     if (section == 1) {
         UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 240)];
         footer.autoresizingMask = UIViewAutoresizingFlexibleWidth;
 
         UIImage *img = [[UIImage alloc] initWithContentsOfFile:@"surprise.png"];
         UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
-        [img release];
         imgView.center = CGPointMake(self.tableView.frame.size.width/2, 120);
         imgView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
         [footer addSubview:imgView];
-        [imgView release];
 
         UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 20)];
         label.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
@@ -165,9 +159,8 @@
         label.backgroundColor = [UIColor clearColor];
         label.center = CGPointMake(self.tableView.frame.size.width/2, 250);
         [footer addSubview:label];
-        [label release];
 
-        return [footer autorelease];
+        return footer;
     } else
         return nil;
 }
@@ -179,19 +172,10 @@
 
 #pragma mark -
 #pragma mark Memory management
+
 -(void)didReceiveMemoryWarning {
     [super didReceiveMemoryWarning];
-}
-
--(void) viewDidUnload {
-    self.waysToSupport = nil;
-    MSG_DIDUNLOAD();
-    [super viewDidUnload];
-}
-
--(void) dealloc {
-    releaseAndNil(waysToSupport);
-    [super dealloc];
+    MSG_MEMCLEAN();
 }
 
 @end