author | nemo |
Fri, 14 Dec 2012 09:53:17 -0500 | |
changeset 8290 | 3240f4500ac1 |
parent 6832 | fae8fd118da9 |
child 8441 | a00b0fa0dbd7 |
permissions | -rw-r--r-- |
3829 | 1 |
/* |
2 |
* Hedgewars-iOS, a Hedgewars port for iOS devices |
|
6700 | 3 |
* Copyright (c) 2009-2012 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 |
||
3547 | 19 |
|
20 |
#import "SingleTeamViewController.h" |
|
4478 | 21 |
#import <QuartzCore/QuartzCore.h> |
3547 | 22 |
#import "HogHatViewController.h" |
23 |
#import "GravesViewController.h" |
|
24 |
#import "VoicesViewController.h" |
|
25 |
#import "FortsViewController.h" |
|
26 |
#import "FlagsViewController.h" |
|
27 |
#import "LevelViewController.h" |
|
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:
5983
diff
changeset
|
28 |
|
3547 | 29 |
|
3660 | 30 |
#define TEAMNAME_TAG 78789 |
3547 | 31 |
|
32 |
@implementation SingleTeamViewController |
|
3816 | 33 |
@synthesize teamDictionary, normalHogSprite, secondaryItems, moreSecondaryItems, teamName; |
3547 | 34 |
|
35 |
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { |
|
36 |
return rotationManager(interfaceOrientation); |
|
37 |
} |
|
38 |
||
39 |
#pragma mark - |
|
3660 | 40 |
#pragma mark editableCellViewDelegate methods |
3547 | 41 |
// set the new value |
3660 | 42 |
-(void) saveTextFieldValue:(NSString *)textString withTag:(NSInteger) tagValue { |
43 |
if (TEAMNAME_TAG == tagValue) { |
|
44 |
// delete old file |
|
45 |
[[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/%@.plist",TEAMS_DIRECTORY(),self.teamName] error:NULL]; |
|
46 |
// update filename |
|
47 |
self.teamName = textString; |
|
48 |
// save new file |
|
49 |
[self writeFile]; |
|
50 |
} else { |
|
51 |
// replace the old value with the new one |
|
52 |
NSMutableDictionary *hog = [[teamDictionary objectForKey:@"hedgehogs"] objectAtIndex:tagValue]; |
|
53 |
[hog setObject:textString forKey:@"hogname"]; |
|
3547 | 54 |
isWriteNeeded = YES; |
55 |
} |
|
56 |
} |
|
57 |
||
58 |
#pragma mark - |
|
59 |
#pragma mark View lifecycle |
|
60 |
-(void) viewDidLoad { |
|
61 |
[super viewDidLoad]; |
|
3697 | 62 |
|
3547 | 63 |
// labels for the entries |
64 |
NSArray *array = [[NSArray alloc] initWithObjects: |
|
65 |
NSLocalizedString(@"Grave",@""), |
|
66 |
NSLocalizedString(@"Voice",@""), |
|
67 |
NSLocalizedString(@"Fort",@""), |
|
68 |
NSLocalizedString(@"Flag",@""), |
|
69 |
NSLocalizedString(@"Level",@""),nil]; |
|
70 |
self.secondaryItems = array; |
|
71 |
[array release]; |
|
3816 | 72 |
|
73 |
// labels for the subtitles |
|
74 |
NSArray *moreArray = [[NSArray alloc] initWithObjects: |
|
75 |
NSLocalizedString(@"Mark the death of your fallen warriors",@""), |
|
76 |
NSLocalizedString(@"Pick a slang your hogs will speak",@""), |
|
77 |
NSLocalizedString(@"Select the team invincible fortress (only valid for fort games)",@""), |
|
78 |
NSLocalizedString(@"Choose a charismatic symbol for your team",@""), |
|
79 |
NSLocalizedString(@"Opt for controlling the team or let the AI lead",@""),nil]; |
|
80 |
self.moreSecondaryItems = moreArray; |
|
81 |
[moreArray release]; |
|
3547 | 82 |
|
83 |
// load the base hog image, drawing will occure in cellForRow... |
|
5983 | 84 |
NSString *normalHogFile = [[NSString alloc] initWithFormat:@"%@/basehat-hedgehog.png",[[NSBundle mainBundle] resourcePath]]; |
85 |
UIImage *hogSprite = [[UIImage alloc] initWithContentsOfFile:normalHogFile]; |
|
3547 | 86 |
[normalHogFile release]; |
87 |
self.normalHogSprite = hogSprite; |
|
88 |
[hogSprite release]; |
|
3697 | 89 |
|
3547 | 90 |
// listen if any childController modifies the plist and write it if needed |
91 |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setWriteNeeded) name:@"setWriteNeedTeams" object:nil]; |
|
92 |
isWriteNeeded = NO; |
|
3697 | 93 |
|
3660 | 94 |
self.title = NSLocalizedString(@"Edit team settings",@""); |
3547 | 95 |
} |
96 |
||
97 |
-(void) viewWillAppear:(BOOL)animated { |
|
98 |
[super viewWillAppear:animated]; |
|
3697 | 99 |
|
3660 | 100 |
// load data about the team and write if there has been a change from other childControllers |
3697 | 101 |
if (isWriteNeeded) |
3547 | 102 |
[self writeFile]; |
3697 | 103 |
|
3660 | 104 |
NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist",TEAMS_DIRECTORY(),self.teamName]; |
3547 | 105 |
NSMutableDictionary *teamDict = [[NSMutableDictionary alloc] initWithContentsOfFile:teamFile]; |
106 |
self.teamDictionary = teamDict; |
|
107 |
[teamDict release]; |
|
108 |
[teamFile release]; |
|
3697 | 109 |
|
3547 | 110 |
[self.tableView reloadData]; |
111 |
} |
|
112 |
||
113 |
// write on file if there has been a change |
|
114 |
-(void) viewWillDisappear:(BOOL)animated { |
|
115 |
[super viewWillDisappear:animated]; |
|
116 |
||
3697 | 117 |
if (isWriteNeeded) |
3660 | 118 |
[self writeFile]; |
3547 | 119 |
} |
120 |
||
121 |
#pragma mark - |
|
122 |
// needed by other classes to warn about a user change |
|
123 |
-(void) setWriteNeeded { |
|
124 |
isWriteNeeded = YES; |
|
125 |
} |
|
126 |
||
127 |
-(void) writeFile { |
|
3660 | 128 |
NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist",TEAMS_DIRECTORY(),self.teamName]; |
129 |
[self.teamDictionary writeToFile:teamFile atomically:YES]; |
|
130 |
[teamFile release]; |
|
3547 | 131 |
|
3789
c3eb56754e92
added a smaller version of forts, fixed a couple of regressions
koda
parents:
3783
diff
changeset
|
132 |
//DLog(@"%@",teamDictionary); |
3547 | 133 |
isWriteNeeded = NO; |
134 |
} |
|
135 |
||
136 |
#pragma mark - |
|
137 |
#pragma mark Table view data source |
|
138 |
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { |
|
139 |
return 3; |
|
140 |
} |
|
141 |
||
142 |
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { |
|
143 |
NSInteger rows = 0; |
|
144 |
switch (section) { |
|
145 |
case 0: // team name |
|
146 |
rows = 1; |
|
147 |
break; |
|
148 |
case 1: // team members |
|
3926
668b71f31e51
use dynamic data from engine instead of using hardcoded values
koda
parents:
3924
diff
changeset
|
149 |
rows = HW_getMaxNumberOfHogs(); |
3547 | 150 |
break; |
151 |
case 2: // team details |
|
152 |
rows = [self.secondaryItems count]; |
|
153 |
break; |
|
154 |
default: |
|
155 |
break; |
|
156 |
} |
|
157 |
return rows; |
|
158 |
} |
|
159 |
||
3660 | 160 |
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { |
161 |
NSString *sectionTitle = nil; |
|
162 |
switch (section) { |
|
163 |
case 0: |
|
164 |
sectionTitle = NSLocalizedString(@"Team Name", @""); |
|
165 |
break; |
|
166 |
case 1: |
|
167 |
sectionTitle = NSLocalizedString(@"Names and Hats", @""); |
|
168 |
break; |
|
169 |
case 2: |
|
170 |
sectionTitle = NSLocalizedString(@"Team Preferences", @""); |
|
171 |
break; |
|
172 |
default: |
|
173 |
DLog(@"Nope"); |
|
174 |
break; |
|
175 |
} |
|
176 |
return sectionTitle; |
|
177 |
} |
|
178 |
||
3547 | 179 |
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
180 |
static NSString *CellIdentifier0 = @"Cell0"; |
|
181 |
static NSString *CellIdentifier1 = @"Cell1"; |
|
182 |
static NSString *CellIdentifier2 = @"Cell2"; |
|
3697 | 183 |
|
3547 | 184 |
NSArray *hogArray; |
185 |
UITableViewCell *cell = nil; |
|
3660 | 186 |
EditableCellView *editableCell = nil; |
3547 | 187 |
NSInteger row = [indexPath row]; |
188 |
UIImage *accessoryImage; |
|
3697 | 189 |
|
3547 | 190 |
switch ([indexPath section]) { |
191 |
case 0: |
|
3660 | 192 |
editableCell = (EditableCellView *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier0]; |
193 |
if (editableCell == nil) { |
|
3697 | 194 |
editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault |
3547 | 195 |
reuseIdentifier:CellIdentifier0] autorelease]; |
3660 | 196 |
editableCell.delegate = self; |
197 |
editableCell.tag = TEAMNAME_TAG; |
|
3547 | 198 |
} |
3697 | 199 |
|
3660 | 200 |
editableCell.imageView.image = nil; |
201 |
editableCell.accessoryType = UITableViewCellAccessoryNone; |
|
202 |
editableCell.textField.text = self.teamName; |
|
203 |
||
204 |
cell = editableCell; |
|
3547 | 205 |
break; |
206 |
case 1: |
|
3660 | 207 |
editableCell = (EditableCellView *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier1]; |
208 |
if (editableCell == nil) { |
|
3697 | 209 |
editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault |
3547 | 210 |
reuseIdentifier:CellIdentifier1] autorelease]; |
3660 | 211 |
editableCell.delegate = self; |
212 |
editableCell.tag = [indexPath row]; |
|
3547 | 213 |
} |
3697 | 214 |
|
3547 | 215 |
hogArray = [self.teamDictionary objectForKey:@"hedgehogs"]; |
3697 | 216 |
|
3660 | 217 |
// draw the hat on top of the hog |
3547 | 218 |
NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/%@.png", HATS_DIRECTORY(), [[hogArray objectAtIndex:row] objectForKey:@"hat"]]; |
219 |
UIImage *hatSprite = [[UIImage alloc] initWithContentsOfFile: hatFile andCutAt:CGRectMake(0, 0, 32, 32)]; |
|
220 |
[hatFile release]; |
|
3948
24daa33a3114
some rethinking of initial menu presentation and initial orientation (also merging images should be threadsafe now)
koda
parents:
3926
diff
changeset
|
221 |
editableCell.imageView.image = [self.normalHogSprite mergeWith:hatSprite atPoint:CGPointMake(0, 5)]; |
3547 | 222 |
[hatSprite release]; |
3697 | 223 |
|
3660 | 224 |
editableCell.textField.text = [[hogArray objectAtIndex:row] objectForKey:@"hogname"]; |
225 |
editableCell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; |
|
3697 | 226 |
|
3660 | 227 |
cell = editableCell; |
3547 | 228 |
break; |
229 |
case 2: |
|
230 |
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier2]; |
|
231 |
if (cell == nil) { |
|
3816 | 232 |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle |
3547 | 233 |
reuseIdentifier:CellIdentifier2] autorelease]; |
234 |
} |
|
3697 | 235 |
|
3547 | 236 |
cell.textLabel.text = [self.secondaryItems objectAtIndex:row]; |
3816 | 237 |
cell.detailTextLabel.text = [self.moreSecondaryItems objectAtIndex:row]; |
3547 | 238 |
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; |
239 |
switch (row) { |
|
240 |
case 0: // grave |
|
241 |
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.png", |
|
242 |
GRAVES_DIRECTORY(),[teamDictionary objectForKey:@"grave"]] |
|
243 |
andCutAt:CGRectMake(0,0,32,32)]; |
|
244 |
cell.imageView.image = accessoryImage; |
|
245 |
[accessoryImage release]; |
|
246 |
break; |
|
3816 | 247 |
case 1: // voice |
248 |
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/HellishBomb.png", |
|
249 |
GRAPHICS_DIRECTORY()]]; |
|
250 |
cell.imageView.image = accessoryImage; |
|
251 |
[accessoryImage release]; |
|
252 |
break; |
|
3547 | 253 |
case 2: // fort |
5982
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
254 |
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@-icon.png", |
3547 | 255 |
FORTS_DIRECTORY(),[teamDictionary objectForKey:@"fort"]]]; |
5982
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
256 |
cell.imageView.image = accessoryImage; |
3547 | 257 |
[accessoryImage release]; |
258 |
break; |
|
259 |
case 3: // flags |
|
260 |
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.png", |
|
261 |
FLAGS_DIRECTORY(),[teamDictionary objectForKey:@"flag"]]]; |
|
5982
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
262 |
cell.imageView.image = [accessoryImage scaleToSize:CGSizeMake(26, 18)]; |
3547 | 263 |
[accessoryImage release]; |
6104 | 264 |
cell.imageView.layer.borderWidth = 1; |
265 |
cell.imageView.layer.borderColor = [[UIColor blackColor] CGColor]; |
|
3547 | 266 |
break; |
267 |
case 4: // level |
|
5982
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
268 |
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/bot%d.png", |
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
269 |
[[NSBundle mainBundle] resourcePath], |
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
270 |
[[[[teamDictionary objectForKey:@"hedgehogs"] |
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
271 |
objectAtIndex:0] objectForKey:@"level"] |
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
272 |
intValue]]]; |
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
273 |
cell.imageView.image = accessoryImage; |
3547 | 274 |
[accessoryImage release]; |
275 |
break; |
|
276 |
default: |
|
277 |
cell.imageView.image = nil; |
|
278 |
break; |
|
279 |
} |
|
280 |
break; |
|
281 |
} |
|
3697 | 282 |
|
3547 | 283 |
return cell; |
284 |
} |
|
285 |
||
286 |
||
287 |
#pragma mark - |
|
288 |
#pragma mark Table view delegate |
|
289 |
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
|
290 |
NSInteger row = [indexPath row]; |
|
291 |
NSInteger section = [indexPath section]; |
|
3697 | 292 |
|
3547 | 293 |
if (2 == section) { |
294 |
switch (row) { |
|
295 |
case 0: // grave |
|
296 |
if (nil == gravesViewController) |
|
297 |
gravesViewController = [[GravesViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
|
3924 | 298 |
|
299 |
[gravesViewController setTeamDictionary:teamDictionary]; |
|
300 |
[self.navigationController pushViewController:gravesViewController animated:YES]; |
|
3547 | 301 |
break; |
302 |
case 1: // voice |
|
303 |
if (nil == voicesViewController) |
|
304 |
voicesViewController = [[VoicesViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
|
3924 | 305 |
|
306 |
[voicesViewController setTeamDictionary:teamDictionary]; |
|
307 |
[self.navigationController pushViewController:voicesViewController animated:YES]; |
|
3547 | 308 |
break; |
309 |
case 2: // fort |
|
310 |
if (nil == fortsViewController) |
|
311 |
fortsViewController = [[FortsViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
|
3924 | 312 |
|
313 |
[fortsViewController setTeamDictionary:teamDictionary]; |
|
314 |
[self.navigationController pushViewController:fortsViewController animated:YES]; |
|
3547 | 315 |
break; |
316 |
case 3: // flag |
|
3697 | 317 |
if (nil == flagsViewController) |
3547 | 318 |
flagsViewController = [[FlagsViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
3924 | 319 |
|
320 |
[flagsViewController setTeamDictionary:teamDictionary]; |
|
321 |
[self.navigationController pushViewController:flagsViewController animated:YES]; |
|
3547 | 322 |
break; |
323 |
case 4: // level |
|
324 |
if (nil == levelViewController) |
|
325 |
levelViewController = [[LevelViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
|
3924 | 326 |
|
327 |
[levelViewController setTeamDictionary:teamDictionary]; |
|
328 |
[self.navigationController pushViewController:levelViewController animated:YES]; |
|
329 |
break; |
|
330 |
default: |
|
331 |
DLog(@"Nope"); |
|
3547 | 332 |
break; |
333 |
} |
|
334 |
} else { |
|
3660 | 335 |
EditableCellView *cell = (EditableCellView *)[aTableView cellForRowAtIndexPath:indexPath]; |
336 |
[cell replyKeyboard]; |
|
3547 | 337 |
[aTableView deselectRowAtIndexPath:indexPath animated:NO]; |
338 |
} |
|
339 |
||
340 |
} |
|
341 |
||
342 |
// action to perform when you want to change a hog hat |
|
3660 | 343 |
-(void) tableView:(UITableView *)aTableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { |
3662
a44406f4369b
polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents:
3660
diff
changeset
|
344 |
if (nil == hogHatViewController) |
3547 | 345 |
hogHatViewController = [[HogHatViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
3697 | 346 |
|
3547 | 347 |
// cache the dictionary file of the team, so that other controllers can modify it |
348 |
hogHatViewController.teamDictionary = self.teamDictionary; |
|
349 |
hogHatViewController.selectedHog = [indexPath row]; |
|
3697 | 350 |
|
3660 | 351 |
// if we are editing the field undo any change before proceeding |
352 |
EditableCellView *cell = (EditableCellView *)[aTableView cellForRowAtIndexPath:indexPath]; |
|
353 |
[cell cancel:nil]; |
|
3697 | 354 |
|
3547 | 355 |
[self.navigationController pushViewController:hogHatViewController animated:YES]; |
356 |
} |
|
357 |
||
358 |
||
359 |
#pragma mark - |
|
360 |
#pragma mark Memory management |
|
361 |
-(void) didReceiveMemoryWarning { |
|
362 |
[super didReceiveMemoryWarning]; |
|
363 |
if (hogHatViewController.view.superview == nil) |
|
364 |
hogHatViewController = nil; |
|
365 |
if (gravesViewController.view.superview == nil) |
|
366 |
gravesViewController = nil; |
|
367 |
if (voicesViewController.view.superview == nil) |
|
368 |
voicesViewController = nil; |
|
369 |
if (fortsViewController.view.superview == nil) |
|
370 |
fortsViewController = nil; |
|
371 |
if (flagsViewController.view.superview == nil) |
|
372 |
flagsViewController = nil; |
|
373 |
if (levelViewController.view.superview == nil) |
|
374 |
levelViewController = nil; |
|
3660 | 375 |
MSG_MEMCLEAN(); |
3547 | 376 |
} |
377 |
||
378 |
-(void) viewDidUnload { |
|
3783 | 379 |
[[NSNotificationCenter defaultCenter] removeObserver:self]; |
3547 | 380 |
self.teamDictionary = nil; |
381 |
self.teamName = nil; |
|
382 |
self.normalHogSprite = nil; |
|
383 |
self.secondaryItems = nil; |
|
3816 | 384 |
self.moreSecondaryItems = nil; |
3547 | 385 |
hogHatViewController = nil; |
3662
a44406f4369b
polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents:
3660
diff
changeset
|
386 |
gravesViewController = nil; |
a44406f4369b
polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents:
3660
diff
changeset
|
387 |
voicesViewController = nil; |
3547 | 388 |
flagsViewController = nil; |
389 |
fortsViewController = nil; |
|
390 |
levelViewController = nil; |
|
3662
a44406f4369b
polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents:
3660
diff
changeset
|
391 |
MSG_DIDUNLOAD(); |
3547 | 392 |
[super viewDidUnload]; |
393 |
} |
|
394 |
||
395 |
-(void) dealloc { |
|
5208 | 396 |
releaseAndNil(teamDictionary); |
397 |
releaseAndNil(teamName); |
|
398 |
releaseAndNil(normalHogSprite); |
|
399 |
releaseAndNil(secondaryItems); |
|
400 |
releaseAndNil(moreSecondaryItems); |
|
401 |
releaseAndNil(hogHatViewController); |
|
402 |
releaseAndNil(gravesViewController); |
|
403 |
releaseAndNil(fortsViewController); |
|
404 |
releaseAndNil(voicesViewController); |
|
405 |
releaseAndNil(flagsViewController); |
|
406 |
releaseAndNil(levelViewController); |
|
3547 | 407 |
[super dealloc]; |
408 |
} |
|
409 |
||
410 |
||
411 |
@end |
|
412 |