author | koda |
Mon, 10 Oct 2011 02:50:01 +0200 | |
changeset 6115 | 485cfecadc9a |
parent 6108 | 7a8da11a6144 |
child 6209 | 074ab6ebcb3e |
permissions | -rw-r--r-- |
3829 | 1 |
/* |
2 |
* Hedgewars-iOS, a Hedgewars port for iOS devices |
|
4976 | 3 |
* Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com> |
3829 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
17 |
* |
|
18 |
* File created on 20/04/2010. |
|
19 |
*/ |
|
20 |
||
3547 | 21 |
|
22 |
#import "TeamConfigViewController.h" |
|
6108 | 23 |
#import <QuartzCore/QuartzCore.h> |
3547 | 24 |
#import "SquareButtonView.h" |
25 |
||
6078
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
5976
diff
changeset
|
26 |
|
3547 | 27 |
@implementation TeamConfigViewController |
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
28 |
@synthesize tableView, selectedTeamsCount, allTeamsCount, listOfAllTeams, listOfSelectedTeams, cachedContentsOfDir; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
29 |
|
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
30 |
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
31 |
return rotationManager(interfaceOrientation); |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
32 |
} |
3547 | 33 |
|
34 |
#pragma mark - |
|
35 |
#pragma mark View lifecycle |
|
36 |
-(void) viewDidLoad { |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
37 |
/* |
3547 | 38 |
CGSize screenSize = [[UIScreen mainScreen] bounds].size; |
39 |
self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44); |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
40 |
*/ |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
41 |
UITableView *aTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
42 |
style:UITableViewStyleGrouped]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
43 |
aTableView.delegate = self; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
44 |
aTableView.dataSource = self; |
6108 | 45 |
if (IS_IPAD()) { |
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
46 |
[aTableView setBackgroundColorForAnyTable:[UIColor darkBlueColorTransparent]]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
47 |
aTableView.layer.borderColor = [[UIColor darkYellowColor] CGColor]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
48 |
aTableView.layer.borderWidth = 2.7f; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
49 |
aTableView.layer.cornerRadius = 8; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
50 |
aTableView.contentInset = UIEdgeInsetsMake(10, 0, 10, 0); |
6108 | 51 |
} else { |
52 |
UIImage *backgroundImage = [[UIImage alloc] initWithContentsOfFile:@"background~iphone.png"]; |
|
53 |
UIImageView *background = [[UIImageView alloc] initWithImage:backgroundImage]; |
|
54 |
[backgroundImage release]; |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
55 |
[aTableView setBackgroundView:background]; |
6108 | 56 |
[background release]; |
57 |
} |
|
4244 | 58 |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
59 |
aTableView.indicatorStyle = UIScrollViewIndicatorStyleWhite; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
60 |
aTableView.separatorColor = [UIColor whiteColor]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
61 |
aTableView.separatorStyle = UITableViewCellSeparatorStyleNone; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
62 |
self.tableView = aTableView; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
63 |
[aTableView release]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
64 |
|
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
65 |
[self.view addSubview:self.tableView]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
66 |
[super viewDidLoad]; |
3547 | 67 |
} |
68 |
||
69 |
-(void) viewWillAppear:(BOOL)animated { |
|
3739 | 70 |
NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:TEAMS_DIRECTORY() error:NULL]; |
3971 | 71 |
if ([self.cachedContentsOfDir isEqualToArray:contentsOfDir] == NO) { |
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
72 |
self.cachedContentsOfDir = contentsOfDir; |
6078
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
5976
diff
changeset
|
73 |
NSArray *colors = [HWUtils teamColors]; |
3551 | 74 |
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:[contentsOfDir count]]; |
75 |
for (int i = 0; i < [contentsOfDir count]; i++) { |
|
76 |
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithObjectsAndKeys: |
|
77 |
[contentsOfDir objectAtIndex:i],@"team", |
|
78 |
[NSNumber numberWithInt:4],@"number", |
|
3917 | 79 |
[colors objectAtIndex:i%[colors count]],@"color",nil]; |
3551 | 80 |
[array addObject:dict]; |
81 |
[dict release]; |
|
82 |
} |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
83 |
self.listOfAllTeams = array; |
3551 | 84 |
[array release]; |
3697 | 85 |
|
3551 | 86 |
NSMutableArray *emptyArray = [[NSMutableArray alloc] initWithObjects:nil]; |
87 |
self.listOfSelectedTeams = emptyArray; |
|
88 |
[emptyArray release]; |
|
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
89 |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
90 |
self.selectedTeamsCount = [self.listOfSelectedTeams count]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
91 |
self.allTeamsCount = [self.listOfAllTeams count]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
92 |
[self.tableView reloadData]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
93 |
} |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
94 |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
95 |
[super viewWillAppear:animated]; |
3547 | 96 |
} |
97 |
||
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
98 |
-(NSInteger) filterNumberOfHogs:(NSInteger) hogs { |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
99 |
NSInteger numberOfHogs; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
100 |
if (hogs <= HW_getMaxNumberOfHogs() && hogs >= 1) |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
101 |
numberOfHogs = hogs; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
102 |
else { |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
103 |
if (hogs > HW_getMaxNumberOfHogs()) |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
104 |
numberOfHogs = 1; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
105 |
else |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
106 |
numberOfHogs = HW_getMaxNumberOfHogs(); |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
107 |
} |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
108 |
return numberOfHogs; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
109 |
} |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
110 |
|
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
111 |
-(UIImage *)drawHogsRepeated:(NSInteger) manyTimes { |
5976
306cedbeb213
fixed several 'retina display' images and added a bunch more (though just from upscaling the normal ones; might be nice to have 'em redrawn at a real higher resolution)
koda
parents:
5208
diff
changeset
|
112 |
NSString *imgString = [[NSString alloc] initWithFormat:@"%@/hedgehog.png",[[NSBundle mainBundle] resourcePath]]; |
306cedbeb213
fixed several 'retina display' images and added a bunch more (though just from upscaling the normal ones; might be nice to have 'em redrawn at a real higher resolution)
koda
parents:
5208
diff
changeset
|
113 |
UIImage *hogSprite = [[UIImage alloc] initWithContentsOfFile:imgString]; |
306cedbeb213
fixed several 'retina display' images and added a bunch more (though just from upscaling the normal ones; might be nice to have 'em redrawn at a real higher resolution)
koda
parents:
5208
diff
changeset
|
114 |
[imgString release]; |
6078
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
5976
diff
changeset
|
115 |
CGFloat screenScale = [[UIScreen mainScreen] scale]; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
116 |
int w = hogSprite.size.width * screenScale; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
117 |
int h = hogSprite.size.height * screenScale; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
118 |
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
119 |
CGContextRef context = CGBitmapContextCreate(NULL, w * 3, h, 8, 4 * w * 3, colorSpace, kCGImageAlphaPremultipliedFirst); |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
120 |
|
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
121 |
// draw the two images in the current context |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
122 |
for (int i = 0; i < manyTimes; i++) |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
123 |
CGContextDrawImage(context, CGRectMake(i*8*screenScale, 0, w, h), [hogSprite CGImage]); |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
124 |
[hogSprite release]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
125 |
|
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
126 |
// Create bitmap image info from pixel data in current context |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
127 |
CGImageRef imageRef = CGBitmapContextCreateImage(context); |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
128 |
|
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
129 |
// Create a new UIImage object |
6078
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
5976
diff
changeset
|
130 |
UIImage *resultImage = [UIImage imageWithCGImage:imageRef scale:screenScale orientation:UIImageOrientationUp]; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
131 |
|
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
132 |
// Release colorspace, context and bitmap information |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
133 |
CGColorSpaceRelease(colorSpace); |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
134 |
CGContextRelease(context); |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
135 |
CFRelease(imageRef); |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
136 |
|
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
137 |
return resultImage; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
138 |
} |
3547 | 139 |
|
140 |
#pragma mark - |
|
141 |
#pragma mark Table view data source |
|
142 |
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { |
|
143 |
return 2; |
|
144 |
} |
|
145 |
||
146 |
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
147 |
return (section == 0 ? self.selectedTeamsCount : self.allTeamsCount); |
3547 | 148 |
} |
149 |
||
150 |
// Customize the appearance of table view cells. |
|
151 |
-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
|
152 |
static NSString *CellIdentifier0 = @"Cell0"; |
|
153 |
static NSString *CellIdentifier1 = @"Cell1"; |
|
154 |
NSInteger section = [indexPath section]; |
|
155 |
UITableViewCell *cell; |
|
3697 | 156 |
|
3547 | 157 |
if (section == 0) { |
158 |
cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier0]; |
|
159 |
if (cell == nil) { |
|
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
160 |
cell = [[[HoldTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier0] autorelease]; |
3697 | 161 |
|
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
162 |
SquareButtonView *squareButton = [[SquareButtonView alloc] initWithFrame:CGRectMake(0, 0, 36, 36)]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
163 |
cell.accessoryView = squareButton; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
164 |
[squareButton release]; |
3547 | 165 |
} |
3697 | 166 |
|
3547 | 167 |
NSMutableDictionary *selectedRow = [listOfSelectedTeams objectAtIndex:[indexPath row]]; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
168 |
cell.textLabel.text = [[selectedRow objectForKey:@"team"] stringByDeletingPathExtension]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
169 |
cell.textLabel.backgroundColor = [UIColor clearColor]; |
3697 | 170 |
|
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
171 |
SquareButtonView *squareButton = (SquareButtonView *)cell.accessoryView; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
172 |
[squareButton selectColor:[[selectedRow objectForKey:@"color"] intValue]]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
173 |
NSNumber *hogNumber = [selectedRow objectForKey:@"number"]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
174 |
[squareButton setTitle:[hogNumber stringValue] forState:UIControlStateNormal]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
175 |
squareButton.ownerDictionary = selectedRow; |
3697 | 176 |
|
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
177 |
cell.imageView.image = [self drawHogsRepeated:[hogNumber intValue]]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
178 |
((HoldTableViewCell *)cell).delegate = self; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
179 |
} else { |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
180 |
cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier1]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
181 |
if (cell == nil) |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
182 |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
183 |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
184 |
cell.textLabel.text = [[[self.listOfAllTeams objectAtIndex:[indexPath row]] objectForKey:@"team"] stringByDeletingPathExtension]; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
185 |
cell.textLabel.backgroundColor = [UIColor clearColor]; |
3814 | 186 |
|
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
187 |
NSString *teamPath = [NSString stringWithFormat:@"%@/%@.plist",TEAMS_DIRECTORY(),cell.textLabel.text]; |
3814 | 188 |
NSDictionary *firstHog = [[[NSDictionary dictionaryWithContentsOfFile:teamPath] objectForKey:@"hedgehogs"] objectAtIndex:0]; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
189 |
if ([[firstHog objectForKey:@"level"] intValue] != 0) { |
5976
306cedbeb213
fixed several 'retina display' images and added a bunch more (though just from upscaling the normal ones; might be nice to have 'em redrawn at a real higher resolution)
koda
parents:
5208
diff
changeset
|
190 |
NSString *imgString = [[NSString alloc] initWithFormat:@"%@/robotBadge.png",[[NSBundle mainBundle] resourcePath]]; |
306cedbeb213
fixed several 'retina display' images and added a bunch more (though just from upscaling the normal ones; might be nice to have 'em redrawn at a real higher resolution)
koda
parents:
5208
diff
changeset
|
191 |
UIImage *sprite = [[UIImage alloc] initWithContentsOfFile:imgString]; |
306cedbeb213
fixed several 'retina display' images and added a bunch more (though just from upscaling the normal ones; might be nice to have 'em redrawn at a real higher resolution)
koda
parents:
5208
diff
changeset
|
192 |
[imgString release]; |
3814 | 193 |
UIImageView *spriteView = [[UIImageView alloc] initWithImage:sprite]; |
194 |
[sprite release]; |
|
195 |
||
196 |
cell.accessoryView = spriteView; |
|
197 |
[spriteView release]; |
|
198 |
} else |
|
199 |
cell.accessoryView = nil; |
|
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
200 |
} |
3697 | 201 |
|
6078
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
5976
diff
changeset
|
202 |
cell.textLabel.textColor = [UIColor lightYellowColor]; |
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
5976
diff
changeset
|
203 |
cell.backgroundColor = [UIColor blackColorTransparent]; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
204 |
cell.selectionStyle = UITableViewCellSelectionStyleNone; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
205 |
|
3547 | 206 |
return cell; |
207 |
} |
|
208 |
||
3703
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
209 |
-(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { |
6108 | 210 |
return 45.0; |
3703
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
211 |
} |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
212 |
|
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
213 |
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { |
3983
aa24192417a8
use labels instead of images, should save ram and space
koda
parents:
3971
diff
changeset
|
214 |
CGRect frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30); |
6078
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
5976
diff
changeset
|
215 |
NSString *text = (section == 0) ? NSLocalizedString(@"Playing Teams",@"") : NSLocalizedString(@"Available Teams",@""); |
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
5976
diff
changeset
|
216 |
UILabel *theLabel = [[UILabel alloc] initWithFrame:frame andTitle:text]; |
3780
7c704e69242e
fade in when returning from game, labels rewritten so that they are drawn at runtime (more flexibility with i18n and iphone support)
koda
parents:
3739
diff
changeset
|
217 |
theLabel.center = CGPointMake(self.view.frame.size.width/2, 20); |
3703
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
218 |
|
3780
7c704e69242e
fade in when returning from game, labels rewritten so that they are drawn at runtime (more flexibility with i18n and iphone support)
koda
parents:
3739
diff
changeset
|
219 |
UIView *theView = [[[UIView alloc] init] autorelease]; |
7c704e69242e
fade in when returning from game, labels rewritten so that they are drawn at runtime (more flexibility with i18n and iphone support)
koda
parents:
3739
diff
changeset
|
220 |
[theView addSubview:theLabel]; |
7c704e69242e
fade in when returning from game, labels rewritten so that they are drawn at runtime (more flexibility with i18n and iphone support)
koda
parents:
3739
diff
changeset
|
221 |
[theLabel release]; |
7c704e69242e
fade in when returning from game, labels rewritten so that they are drawn at runtime (more flexibility with i18n and iphone support)
koda
parents:
3739
diff
changeset
|
222 |
return theView; |
3703
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
223 |
} |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
224 |
|
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
225 |
-(CGFloat) tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { |
4538 | 226 |
return IS_IPAD() ? 40 : 20; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
227 |
} |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
228 |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
229 |
-(UIView *)tableView:(UITableView *)aTableView viewForFooterInSection:(NSInteger) section { |
4538 | 230 |
NSInteger height = IS_IPAD() ? 40 : 20; |
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
231 |
UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, aTableView.frame.size.width, height)]; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
232 |
footer.backgroundColor = [UIColor clearColor]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
233 |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
234 |
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, aTableView.frame.size.width*80/100, height)]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
235 |
label.center = CGPointMake(aTableView.frame.size.width/2, height/2); |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
236 |
label.textAlignment = UITextAlignmentCenter; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
237 |
label.font = [UIFont italicSystemFontOfSize:12]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
238 |
label.textColor = [UIColor whiteColor]; |
4538 | 239 |
label.numberOfLines = 2; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
240 |
if (section == 0) |
4538 | 241 |
label.text = NSLocalizedString(@"Tap to add hogs or change color, touch and hold to remove a team.",@""); |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
242 |
else |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
243 |
label.text = NSLocalizedString(@"The robot badge indicates an AI-controlled team.",@""); |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
244 |
|
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
245 |
label.backgroundColor = [UIColor clearColor]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
246 |
[footer addSubview:label]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
247 |
[label release]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
248 |
return [footer autorelease]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
249 |
} |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
250 |
|
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
251 |
|
3547 | 252 |
#pragma mark - |
253 |
#pragma mark Table view delegate |
|
254 |
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
|
255 |
NSInteger row = [indexPath row]; |
|
256 |
NSInteger section = [indexPath section]; |
|
257 |
||
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
258 |
if (section == 1 && [self.listOfAllTeams count] > row) { |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
259 |
[self.listOfSelectedTeams addObject:[self.listOfAllTeams objectAtIndex:row]]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
260 |
[self.listOfAllTeams removeObjectAtIndex:row]; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
261 |
|
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
262 |
NSIndexPath *newIndexPath = [NSIndexPath indexPathForRow:selectedTeamsCount inSection:0]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
263 |
allTeamsCount--; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
264 |
selectedTeamsCount++; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
265 |
[aTableView beginUpdates]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
266 |
[aTableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationRight]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
267 |
[aTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationRight]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
268 |
[aTableView endUpdates]; |
3547 | 269 |
} |
4486 | 270 |
if (section == 0 && [self.listOfSelectedTeams count] > row) { |
271 |
NSMutableDictionary *selectedRow = [self.listOfSelectedTeams objectAtIndex:row]; |
|
272 |
UITableViewCell *cell = [aTableView cellForRowAtIndexPath:indexPath]; |
|
273 |
SquareButtonView *squareButton = (SquareButtonView *)cell.accessoryView; |
|
274 |
||
275 |
NSInteger increaseNumber = [[selectedRow objectForKey:@"number"] intValue] + 1; |
|
276 |
NSNumber *newNumber = [NSNumber numberWithInt:[self filterNumberOfHogs:increaseNumber]]; |
|
277 |
[squareButton setTitle:[newNumber stringValue] forState:UIControlStateNormal]; |
|
278 |
[selectedRow setObject:newNumber forKey:@"number"]; |
|
279 |
||
280 |
cell.imageView.image = [self drawHogsRepeated:[newNumber intValue]]; |
|
281 |
} |
|
3547 | 282 |
} |
283 |
||
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
284 |
-(void) holdAction:(NSString *)content onTable:(UITableView *)aTableView { |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
285 |
NSInteger row; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
286 |
for (row = 0; row < [self.listOfSelectedTeams count]; row++) { |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
287 |
NSDictionary *dict = [self.listOfSelectedTeams objectAtIndex:row]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
288 |
if ([content isEqualToString:[[dict objectForKey:@"team"] stringByDeletingPathExtension]]) |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
289 |
break; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
290 |
} |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
291 |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
292 |
[self.listOfAllTeams addObject:[self.listOfSelectedTeams objectAtIndex:row]]; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
293 |
[self.listOfSelectedTeams removeObjectAtIndex:row]; |
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
294 |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
295 |
[aTableView beginUpdates]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
296 |
[aTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationLeft]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
297 |
[aTableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:allTeamsCount inSection:1]] withRowAnimation:UITableViewRowAnimationLeft]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
298 |
self.allTeamsCount++; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
299 |
self.selectedTeamsCount--; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
300 |
[aTableView endUpdates]; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4356
diff
changeset
|
301 |
} |
3547 | 302 |
|
303 |
#pragma mark - |
|
304 |
#pragma mark Memory management |
|
305 |
-(void) didReceiveMemoryWarning { |
|
6107 | 306 |
if ([[HedgewarsAppDelegate sharedAppDelegate] isInGame]) { |
307 |
self.listOfSelectedTeams = nil; |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
308 |
self.listOfAllTeams = nil; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
309 |
self.tableView = nil; |
6107 | 310 |
} |
3739 | 311 |
self.cachedContentsOfDir = nil; |
3971 | 312 |
MSG_MEMCLEAN(); |
313 |
[super didReceiveMemoryWarning]; |
|
3547 | 314 |
} |
315 |
||
316 |
-(void) viewDidUnload { |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
317 |
self.tableView = nil; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
318 |
self.listOfAllTeams = nil; |
3739 | 319 |
self.listOfSelectedTeams = nil; |
320 |
self.cachedContentsOfDir = nil; |
|
3662
a44406f4369b
polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents:
3659
diff
changeset
|
321 |
MSG_DIDUNLOAD(); |
3547 | 322 |
[super viewDidUnload]; |
323 |
} |
|
324 |
||
325 |
||
326 |
-(void) dealloc { |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
327 |
releaseAndNil(tableView); |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6108
diff
changeset
|
328 |
releaseAndNil(listOfAllTeams); |
5208 | 329 |
releaseAndNil(listOfSelectedTeams); |
330 |
releaseAndNil(cachedContentsOfDir); |
|
3547 | 331 |
[super dealloc]; |
332 |
} |
|
333 |
||
334 |
||
335 |
@end |
|
336 |