colorWithPatternImage uses too much memory
authorkoda
Sun, 12 Feb 2012 15:04:17 +0100
changeset 6673 1ee72dcea263
parent 6672 4f728ccdd06b
child 6674 4d3209a189ca
colorWithPatternImage uses too much memory
project_files/HedgewarsMobile/Classes/AboutViewController.m
project_files/HedgewarsMobile/Classes/MainMenuViewController-iPad.xib
project_files/HedgewarsMobile/Classes/SavedGamesViewController.m
project_files/HedgewarsMobile/Classes/SavedGamesViewController.xib
project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj
project_files/HedgewarsMobile/Resources/Frontend/smallerBackground~ipad.png
--- a/project_files/HedgewarsMobile/Classes/AboutViewController.m	Sun Feb 12 11:05:26 2012 +0100
+++ b/project_files/HedgewarsMobile/Classes/AboutViewController.m	Sun Feb 12 15:04:17 2012 +0100
@@ -30,8 +30,7 @@
 }
 
 -(void) viewDidLoad {
-    if ([self.tableView respondsToSelector:@selector(setBackgroundView:)])
-        self.tableView.backgroundView = nil;
+    [self.tableView setBackgroundColorForAnyTable:[UIColor clearColor]];
     self.tableView.allowsSelection = NO;
 
     NSArray *array = [[NSArray alloc] initWithContentsOfFile:CREDITS_FILE()];
@@ -44,8 +43,13 @@
     else
         imgName = @"smallerBackground~iphone.png";
     UIImage *img = [[UIImage alloc] initWithContentsOfFile:imgName];
-    self.view.backgroundColor = [UIColor colorWithPatternImage:img];
+    UIImageView *background = [[UIImageView alloc] initWithImage:img];
     [img release];
+    background.frame = self.view.frame;
+    background.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [self.view insertSubview:background atIndex:0];
+    [background release];
+
     [super viewDidLoad];
 }
 
--- a/project_files/HedgewarsMobile/Classes/MainMenuViewController-iPad.xib	Sun Feb 12 11:05:26 2012 +0100
+++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController-iPad.xib	Sun Feb 12 15:04:17 2012 +0100
@@ -94,6 +94,7 @@
 						<int key="NSvFlags">289</int>
 						<string key="NSFrame">{{986, 19}, {18, 19}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
+						<bool key="IBUIOpaque">NO</bool>
 						<bool key="IBUIClipsSubviews">YES</bool>
 						<float key="IBUIAlpha">0.31690141558647156</float>
 						<int key="IBUITag">3</int>
--- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m	Sun Feb 12 11:05:26 2012 +0100
+++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m	Sun Feb 12 15:04:17 2012 +0100
@@ -41,13 +41,16 @@
 }
 
 -(void) viewDidLoad {
-    if ([self.tableView respondsToSelector:@selector(setBackgroundView:)])
-        self.tableView.backgroundView = nil;
+    [self.tableView setBackgroundColorForAnyTable:[UIColor clearColor]];
 
     NSString *imgName = (IS_IPAD()) ? @"mediumBackground~ipad.png" : @"smallerBackground~iphone.png";
     UIImage *img = [[UIImage alloc] initWithContentsOfFile:imgName];
-    self.view.backgroundColor = [UIColor colorWithPatternImage:img];
+    UIImageView *background = [[UIImageView alloc] initWithImage:img];
     [img release];
+    background.frame = self.view.frame;
+    background.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [self.view insertSubview:background atIndex:0];
+    [background release];
 
     if (self.listOfSavegames == nil)
         [self updateTable];
--- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.xib	Sun Feb 12 11:05:26 2012 +0100
+++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.xib	Sun Feb 12 15:04:17 2012 +0100
@@ -12,7 +12,7 @@
 		</object>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
-			<integer value="4"/>
+			<integer value="7"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
@@ -78,8 +78,8 @@
 						<string key="NSFrame">{{0, 44}, {768, 724}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
 						<object class="NSColor" key="IBUIBackgroundColor">
-							<int key="NSColorSpace">1</int>
-							<bytes key="NSRGB">MCAwIDAgMAA</bytes>
+							<int key="NSColorSpace">3</int>
+							<bytes key="NSWhite">MCAwAA</bytes>
 						</object>
 						<bool key="IBUIClipsSubviews">YES</bool>
 						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
@@ -273,42 +273,14 @@
 					<string key="className">SavedGamesViewController</string>
 					<string key="superclassName">UIViewController</string>
 					<object class="NSMutableDictionary" key="actions">
-						<bool key="EncodedWithXMLCoder">YES</bool>
-						<object class="NSArray" key="dict.sortedKeys">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<string>buttonPressed:</string>
-							<string>clearAll:</string>
-							<string>toggleEdit:</string>
-						</object>
-						<object class="NSMutableArray" key="dict.values">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<string>id</string>
-							<string>id</string>
-							<string>id</string>
-						</object>
+						<string key="NS.key.0">buttonPressed:</string>
+						<string key="NS.object.0">id</string>
 					</object>
 					<object class="NSMutableDictionary" key="actionInfosByName">
-						<bool key="EncodedWithXMLCoder">YES</bool>
-						<object class="NSArray" key="dict.sortedKeys">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<string>buttonPressed:</string>
-							<string>clearAll:</string>
-							<string>toggleEdit:</string>
-						</object>
-						<object class="NSMutableArray" key="dict.values">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<object class="IBActionInfo">
-								<string key="name">buttonPressed:</string>
-								<string key="candidateClassName">id</string>
-							</object>
-							<object class="IBActionInfo">
-								<string key="name">clearAll:</string>
-								<string key="candidateClassName">id</string>
-							</object>
-							<object class="IBActionInfo">
-								<string key="name">toggleEdit:</string>
-								<string key="candidateClassName">id</string>
-							</object>
+						<string key="NS.key.0">buttonPressed:</string>
+						<object class="IBActionInfo" key="NS.object.0">
+							<string key="name">buttonPressed:</string>
+							<string key="candidateClassName">id</string>
 						</object>
 					</object>
 					<object class="NSMutableDictionary" key="outlets">
@@ -327,6 +299,13 @@
 						<string key="minorKey">Classes/SavedGamesViewController.h</string>
 					</object>
 				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">UITableView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Classes/ExtraCategories.h</string>
+					</object>
+				</object>
 			</object>
 			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
 				<bool key="EncodedWithXMLCoder">YES</bool>
--- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sun Feb 12 11:05:26 2012 +0100
+++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sun Feb 12 15:04:17 2012 +0100
@@ -744,8 +744,8 @@
 				6163EE6C11CC253F001C0453 /* Overlay */,
 				616591F011CA9BA200D6E256 /* MainMenuViewController.h */,
 				616591F111CA9BA200D6E256 /* MainMenuViewController.m */,
+				6165924B11CA9CB400D6E256 /* MainMenuViewController-iPad.xib */,
 				6165924C11CA9CB400D6E256 /* MainMenuViewController-iPhone.xib */,
-				6165924B11CA9CB400D6E256 /* MainMenuViewController-iPad.xib */,
 				61EDB5AE135B3F97009B29A6 /* GameInterfaceBridge.h */,
 				61EDB5AF135B3F97009B29A6 /* GameInterfaceBridge.m */,
 				616591E611CA9BA200D6E256 /* EngineProtocolNetwork.h */,
Binary file project_files/HedgewarsMobile/Resources/Frontend/smallerBackground~ipad.png has changed