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