3547
|
1 |
//
|
|
2 |
// SingleTeamViewController.m
|
|
3 |
// HedgewarsMobile
|
|
4 |
//
|
|
5 |
// Created by Vittorio on 02/04/10.
|
|
6 |
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
|
7 |
//
|
|
8 |
|
|
9 |
#import "SingleTeamViewController.h"
|
|
10 |
#import "HogHatViewController.h"
|
|
11 |
#import "GravesViewController.h"
|
|
12 |
#import "VoicesViewController.h"
|
|
13 |
#import "FortsViewController.h"
|
|
14 |
#import "FlagsViewController.h"
|
|
15 |
#import "LevelViewController.h"
|
|
16 |
#import "CommodityFunctions.h"
|
|
17 |
#import "UIImageExtra.h"
|
|
18 |
|
|
19 |
#define TEAMNAME_TAG 1234
|
|
20 |
|
|
21 |
@implementation SingleTeamViewController
|
|
22 |
@synthesize teamDictionary, normalHogSprite, secondaryItems, textFieldBeingEdited, teamName;
|
|
23 |
|
|
24 |
|
|
25 |
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
|
|
26 |
return rotationManager(interfaceOrientation);
|
|
27 |
}
|
|
28 |
|
|
29 |
|
|
30 |
#pragma mark -
|
|
31 |
#pragma mark textfield methods
|
|
32 |
-(void) cancel:(id) sender {
|
|
33 |
if (textFieldBeingEdited != nil)
|
|
34 |
[self.textFieldBeingEdited resignFirstResponder];
|
|
35 |
}
|
|
36 |
|
|
37 |
// set the new value
|
|
38 |
-(BOOL) save:(id) sender {
|
|
39 |
NSInteger index = textFieldBeingEdited.tag;
|
|
40 |
|
|
41 |
if (textFieldBeingEdited != nil) {
|
|
42 |
if (TEAMNAME_TAG == index) {
|
3574
|
43 |
if ([textFieldBeingEdited.text length] == 0)
|
|
44 |
textFieldBeingEdited.text = self.title;
|
3547
|
45 |
[self.teamDictionary setObject:textFieldBeingEdited.text forKey:@"teamname"];
|
3574
|
46 |
self.title = textFieldBeingEdited.text;
|
3547
|
47 |
} else {
|
3574
|
48 |
if ([textFieldBeingEdited.text length] == 0)
|
|
49 |
textFieldBeingEdited.text = [NSString stringWithFormat:@"hedgehog %d",index];
|
|
50 |
|
3547
|
51 |
//replace the old value with the new one
|
|
52 |
NSMutableDictionary *hog = [[teamDictionary objectForKey:@"hedgehogs"] objectAtIndex:index];
|
|
53 |
[hog setObject:textFieldBeingEdited.text forKey:@"hogname"];
|
|
54 |
}
|
|
55 |
|
|
56 |
isWriteNeeded = YES;
|
|
57 |
[self.textFieldBeingEdited resignFirstResponder];
|
|
58 |
return YES;
|
|
59 |
}
|
|
60 |
return NO;
|
|
61 |
}
|
|
62 |
|
|
63 |
// the textfield is being modified, update the navigation controller
|
|
64 |
-(void) textFieldDidBeginEditing:(UITextField *)aTextField{
|
|
65 |
self.textFieldBeingEdited = aTextField;
|
|
66 |
|
|
67 |
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Cancel",@"from the hog name table")
|
|
68 |
style:UIBarButtonItemStylePlain
|
|
69 |
target:self
|
|
70 |
action:@selector(cancel:)];
|
|
71 |
self.navigationItem.leftBarButtonItem = cancelButton;
|
|
72 |
[cancelButton release];
|
|
73 |
|
|
74 |
UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Save",@"from the hog name table")
|
|
75 |
style:UIBarButtonItemStyleDone
|
|
76 |
target:self
|
|
77 |
action:@selector(save:)];
|
|
78 |
self.navigationItem.rightBarButtonItem = saveButton;
|
|
79 |
[saveButton release];
|
|
80 |
}
|
|
81 |
|
|
82 |
// the textfield has been modified, check for empty strings and restore original navigation bar
|
|
83 |
-(void) textFieldDidEndEditing:(UITextField *)aTextField{
|
|
84 |
if ([textFieldBeingEdited.text length] == 0)
|
|
85 |
textFieldBeingEdited.text = [NSString stringWithFormat:@"hedgehog %d",textFieldBeingEdited.tag];
|
|
86 |
|
|
87 |
self.textFieldBeingEdited = nil;
|
|
88 |
self.navigationItem.rightBarButtonItem = self.navigationItem.backBarButtonItem;
|
|
89 |
self.navigationItem.leftBarButtonItem = nil;
|
|
90 |
}
|
|
91 |
|
|
92 |
// limit the size of the field to 64 characters like in original frontend
|
|
93 |
-(BOOL) textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
|
|
94 |
int limit = 64;
|
|
95 |
return !([textField.text length] > limit && [string length] > range.length);
|
|
96 |
}
|
|
97 |
|
|
98 |
|
|
99 |
#pragma mark -
|
|
100 |
#pragma mark View lifecycle
|
|
101 |
-(void) viewDidLoad {
|
|
102 |
[super viewDidLoad];
|
|
103 |
|
|
104 |
// labels for the entries
|
|
105 |
NSArray *array = [[NSArray alloc] initWithObjects:
|
|
106 |
NSLocalizedString(@"Grave",@""),
|
|
107 |
NSLocalizedString(@"Voice",@""),
|
|
108 |
NSLocalizedString(@"Fort",@""),
|
|
109 |
NSLocalizedString(@"Flag",@""),
|
|
110 |
NSLocalizedString(@"Level",@""),nil];
|
|
111 |
self.secondaryItems = array;
|
|
112 |
[array release];
|
|
113 |
|
|
114 |
// load the base hog image, drawing will occure in cellForRow...
|
|
115 |
NSString *normalHogFile = [[NSString alloc] initWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()];
|
|
116 |
UIImage *hogSprite = [[UIImage alloc] initWithContentsOfFile:normalHogFile andCutAt:CGRectMake(96, 0, 32, 32)];
|
|
117 |
[normalHogFile release];
|
|
118 |
self.normalHogSprite = hogSprite;
|
|
119 |
[hogSprite release];
|
|
120 |
|
|
121 |
// listen if any childController modifies the plist and write it if needed
|
|
122 |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setWriteNeeded) name:@"setWriteNeedTeams" object:nil];
|
|
123 |
isWriteNeeded = NO;
|
|
124 |
}
|
|
125 |
|
|
126 |
-(void) viewWillAppear:(BOOL)animated {
|
|
127 |
[super viewWillAppear:animated];
|
|
128 |
|
|
129 |
// load data about the team and write if there has been a change
|
|
130 |
if (isWriteNeeded)
|
|
131 |
[self writeFile];
|
|
132 |
|
|
133 |
NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist",TEAMS_DIRECTORY(),self.title];
|
|
134 |
NSMutableDictionary *teamDict = [[NSMutableDictionary alloc] initWithContentsOfFile:teamFile];
|
|
135 |
self.teamDictionary = teamDict;
|
|
136 |
[teamDict release];
|
|
137 |
[teamFile release];
|
|
138 |
|
|
139 |
self.teamName = self.title;
|
|
140 |
|
|
141 |
[self.tableView reloadData];
|
|
142 |
}
|
|
143 |
|
|
144 |
// write on file if there has been a change
|
|
145 |
-(void) viewWillDisappear:(BOOL)animated {
|
|
146 |
[super viewWillDisappear:animated];
|
|
147 |
|
|
148 |
// end the editing of the current field
|
|
149 |
if (textFieldBeingEdited != nil) {
|
|
150 |
[self save:nil];
|
|
151 |
}
|
|
152 |
|
|
153 |
if (isWriteNeeded)
|
|
154 |
[self writeFile];
|
|
155 |
}
|
|
156 |
|
|
157 |
#pragma mark -
|
|
158 |
// needed by other classes to warn about a user change
|
|
159 |
-(void) setWriteNeeded {
|
|
160 |
isWriteNeeded = YES;
|
|
161 |
}
|
|
162 |
|
|
163 |
-(void) writeFile {
|
|
164 |
NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist",TEAMS_DIRECTORY(),self.title];
|
|
165 |
|
|
166 |
NSString *newTeamName = [self.teamDictionary objectForKey:@"teamname"];
|
|
167 |
if (![newTeamName isEqualToString:self.teamName]) {
|
|
168 |
//delete old
|
|
169 |
[[NSFileManager defaultManager] removeItemAtPath:teamFile error:NULL];
|
|
170 |
[teamFile release];
|
|
171 |
self.title = newTeamName;
|
|
172 |
self.teamName = newTeamName;
|
|
173 |
teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist",TEAMS_DIRECTORY(),newTeamName];
|
|
174 |
}
|
|
175 |
|
|
176 |
[self.teamDictionary writeToFile:teamFile atomically:YES];
|
|
177 |
NSLog(@"writing: %@",teamDictionary);
|
|
178 |
isWriteNeeded = NO;
|
|
179 |
[teamFile release];
|
|
180 |
}
|
|
181 |
|
|
182 |
#pragma mark -
|
|
183 |
#pragma mark Table view data source
|
|
184 |
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
|
|
185 |
return 3;
|
|
186 |
}
|
|
187 |
|
|
188 |
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
189 |
NSInteger rows = 0;
|
|
190 |
switch (section) {
|
|
191 |
case 0: // team name
|
|
192 |
rows = 1;
|
|
193 |
break;
|
|
194 |
case 1: // team members
|
|
195 |
rows = MAX_HOGS;
|
|
196 |
break;
|
|
197 |
case 2: // team details
|
|
198 |
rows = [self.secondaryItems count];
|
|
199 |
break;
|
|
200 |
default:
|
|
201 |
break;
|
|
202 |
}
|
|
203 |
return rows;
|
|
204 |
}
|
|
205 |
|
|
206 |
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
207 |
static NSString *CellIdentifier0 = @"Cell0";
|
|
208 |
static NSString *CellIdentifier1 = @"Cell1";
|
|
209 |
static NSString *CellIdentifier2 = @"Cell2";
|
|
210 |
|
|
211 |
NSArray *hogArray;
|
|
212 |
UITableViewCell *cell = nil;
|
|
213 |
NSInteger row = [indexPath row];
|
|
214 |
UIImage *accessoryImage;
|
|
215 |
|
|
216 |
switch ([indexPath section]) {
|
|
217 |
case 0:
|
|
218 |
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier0];
|
|
219 |
if (cell == nil) {
|
|
220 |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
|
|
221 |
reuseIdentifier:CellIdentifier0] autorelease];
|
|
222 |
// create a uitextfield for each row, expand it to take the maximum size
|
|
223 |
UITextField *aTextField = [[UITextField alloc]
|
|
224 |
initWithFrame:CGRectMake(5, 12, (cell.frame.size.width + cell.frame.size.width/3) - 42, 25)];
|
|
225 |
aTextField.clearsOnBeginEditing = NO;
|
|
226 |
aTextField.returnKeyType = UIReturnKeyDone;
|
|
227 |
aTextField.adjustsFontSizeToFitWidth = YES;
|
|
228 |
aTextField.delegate = self;
|
|
229 |
aTextField.tag = [indexPath row];
|
|
230 |
aTextField.font = [UIFont boldSystemFontOfSize:[UIFont systemFontSize] + 2];
|
|
231 |
aTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
|
|
232 |
[aTextField addTarget:self action:@selector(save:) forControlEvents:UIControlEventEditingDidEndOnExit];
|
|
233 |
[cell.contentView addSubview:aTextField];
|
|
234 |
[aTextField release];
|
|
235 |
}
|
|
236 |
|
|
237 |
cell.imageView.image = nil;
|
|
238 |
cell.accessoryType = UITableViewCellAccessoryNone;
|
|
239 |
for (UIView *oneView in cell.contentView.subviews) {
|
|
240 |
if ([oneView isMemberOfClass:[UITextField class]]) {
|
|
241 |
// we find the uitextfied and we'll use its tag to understand which one is being edited
|
|
242 |
UITextField *textFieldFound = (UITextField *)oneView;
|
|
243 |
textFieldFound.text = [self.teamDictionary objectForKey:@"teamname"];
|
|
244 |
textFieldFound.tag = TEAMNAME_TAG;
|
|
245 |
}
|
|
246 |
}
|
|
247 |
break;
|
|
248 |
case 1:
|
|
249 |
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier1];
|
|
250 |
if (cell == nil) {
|
|
251 |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
|
|
252 |
reuseIdentifier:CellIdentifier1] autorelease];
|
|
253 |
|
|
254 |
// create a uitextfield for each row, expand it to take the maximum size
|
|
255 |
UITextField *aTextField = [[UITextField alloc]
|
|
256 |
initWithFrame:CGRectMake(42, 12, (cell.frame.size.width + cell.frame.size.width/3) - 42, 25)];
|
|
257 |
aTextField.clearsOnBeginEditing = NO;
|
|
258 |
aTextField.returnKeyType = UIReturnKeyDone;
|
|
259 |
aTextField.adjustsFontSizeToFitWidth = YES;
|
|
260 |
aTextField.delegate = self;
|
|
261 |
aTextField.tag = [indexPath row];
|
|
262 |
aTextField.font = [UIFont boldSystemFontOfSize:[UIFont systemFontSize] + 2];
|
|
263 |
aTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
|
|
264 |
[aTextField addTarget:self action:@selector(save:) forControlEvents:UIControlEventEditingDidEndOnExit];
|
|
265 |
[cell.contentView addSubview:aTextField];
|
|
266 |
[aTextField release];
|
|
267 |
}
|
|
268 |
|
|
269 |
hogArray = [self.teamDictionary objectForKey:@"hedgehogs"];
|
|
270 |
|
|
271 |
NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/%@.png", HATS_DIRECTORY(), [[hogArray objectAtIndex:row] objectForKey:@"hat"]];
|
|
272 |
UIImage *hatSprite = [[UIImage alloc] initWithContentsOfFile: hatFile andCutAt:CGRectMake(0, 0, 32, 32)];
|
|
273 |
[hatFile release];
|
|
274 |
cell.imageView.image = [self.normalHogSprite mergeWith:hatSprite atPoint:CGPointMake(0, -5)];
|
|
275 |
[hatSprite release];
|
|
276 |
|
|
277 |
for (UIView *oneView in cell.contentView.subviews) {
|
|
278 |
if ([oneView isMemberOfClass:[UITextField class]]) {
|
|
279 |
// we find the uitextfied and we'll use its tag to understand which one is being edited
|
|
280 |
UITextField *textFieldFound = (UITextField *)oneView;
|
|
281 |
textFieldFound.text = [[hogArray objectAtIndex:row] objectForKey:@"hogname"];
|
|
282 |
}
|
|
283 |
}
|
|
284 |
|
|
285 |
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
|
|
286 |
break;
|
|
287 |
case 2:
|
|
288 |
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier2];
|
|
289 |
if (cell == nil) {
|
|
290 |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
|
|
291 |
reuseIdentifier:CellIdentifier2] autorelease];
|
|
292 |
}
|
|
293 |
|
|
294 |
cell.textLabel.text = [self.secondaryItems objectAtIndex:row];
|
|
295 |
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
|
296 |
switch (row) {
|
|
297 |
case 0: // grave
|
|
298 |
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.png",
|
|
299 |
GRAVES_DIRECTORY(),[teamDictionary objectForKey:@"grave"]]
|
|
300 |
andCutAt:CGRectMake(0,0,32,32)];
|
|
301 |
cell.imageView.image = accessoryImage;
|
|
302 |
[accessoryImage release];
|
|
303 |
break;
|
|
304 |
case 2: // fort
|
|
305 |
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@L.png",
|
|
306 |
FORTS_DIRECTORY(),[teamDictionary objectForKey:@"fort"]]];
|
|
307 |
cell.imageView.image = [accessoryImage scaleToSize:CGSizeMake(42, 42)];
|
|
308 |
[accessoryImage release];
|
|
309 |
break;
|
|
310 |
|
|
311 |
case 3: // flags
|
|
312 |
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.png",
|
|
313 |
FLAGS_DIRECTORY(),[teamDictionary objectForKey:@"flag"]]];
|
|
314 |
cell.imageView.image = accessoryImage;
|
|
315 |
[accessoryImage release];
|
|
316 |
break;
|
|
317 |
case 4: // level
|
|
318 |
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%d.png",
|
|
319 |
BOTLEVELS_DIRECTORY(),[[[[teamDictionary objectForKey:@"hedgehogs"]
|
|
320 |
objectAtIndex:0] objectForKey:@"level"]
|
|
321 |
intValue]]];
|
|
322 |
cell.imageView.image = accessoryImage;
|
|
323 |
[accessoryImage release];
|
|
324 |
break;
|
|
325 |
default:
|
|
326 |
cell.imageView.image = nil;
|
|
327 |
break;
|
|
328 |
}
|
|
329 |
break;
|
|
330 |
}
|
|
331 |
|
|
332 |
return cell;
|
|
333 |
}
|
|
334 |
|
|
335 |
|
|
336 |
#pragma mark -
|
|
337 |
#pragma mark Table view delegate
|
|
338 |
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
339 |
NSInteger row = [indexPath row];
|
|
340 |
NSInteger section = [indexPath section];
|
|
341 |
UITableViewController *nextController = nil;
|
|
342 |
UITableViewCell *cell;
|
|
343 |
|
|
344 |
if (2 == section) {
|
|
345 |
switch (row) {
|
|
346 |
case 0: // grave
|
|
347 |
if (nil == gravesViewController)
|
|
348 |
gravesViewController = [[GravesViewController alloc] initWithStyle:UITableViewStyleGrouped];
|
|
349 |
|
|
350 |
nextController = gravesViewController;
|
|
351 |
break;
|
|
352 |
case 1: // voice
|
|
353 |
if (nil == voicesViewController)
|
|
354 |
voicesViewController = [[VoicesViewController alloc] initWithStyle:UITableViewStyleGrouped];
|
|
355 |
|
|
356 |
nextController = voicesViewController;
|
|
357 |
break;
|
|
358 |
case 2: // fort
|
|
359 |
if (nil == fortsViewController)
|
|
360 |
fortsViewController = [[FortsViewController alloc] initWithStyle:UITableViewStyleGrouped];
|
|
361 |
|
|
362 |
nextController = fortsViewController;
|
|
363 |
break;
|
|
364 |
case 3: // flag
|
|
365 |
if (nil == flagsViewController)
|
|
366 |
flagsViewController = [[FlagsViewController alloc] initWithStyle:UITableViewStyleGrouped];
|
|
367 |
|
|
368 |
nextController = flagsViewController;
|
|
369 |
break;
|
|
370 |
case 4: // level
|
|
371 |
if (nil == levelViewController)
|
|
372 |
levelViewController = [[LevelViewController alloc] initWithStyle:UITableViewStyleGrouped];
|
|
373 |
|
|
374 |
nextController = levelViewController;
|
|
375 |
break;
|
|
376 |
}
|
|
377 |
|
|
378 |
nextController.title = [secondaryItems objectAtIndex:row];
|
|
379 |
[nextController setTeamDictionary:teamDictionary];
|
|
380 |
[self.navigationController pushViewController:nextController animated:YES];
|
3659
|
381 |
[nextController release];
|
3547
|
382 |
} else {
|
|
383 |
cell = [aTableView cellForRowAtIndexPath:indexPath];
|
|
384 |
for (UIView *oneView in cell.contentView.subviews) {
|
|
385 |
if ([oneView isMemberOfClass:[UITextField class]]) {
|
|
386 |
textFieldBeingEdited = (UITextField *)oneView;
|
|
387 |
[textFieldBeingEdited becomeFirstResponder];
|
|
388 |
}
|
|
389 |
}
|
|
390 |
[aTableView deselectRowAtIndexPath:indexPath animated:NO];
|
|
391 |
}
|
|
392 |
|
|
393 |
}
|
|
394 |
|
|
395 |
// action to perform when you want to change a hog hat
|
|
396 |
-(void) tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
|
|
397 |
if (nil == hogHatViewController) {
|
|
398 |
hogHatViewController = [[HogHatViewController alloc] initWithStyle:UITableViewStyleGrouped];
|
|
399 |
}
|
|
400 |
|
|
401 |
// cache the dictionary file of the team, so that other controllers can modify it
|
|
402 |
hogHatViewController.teamDictionary = self.teamDictionary;
|
|
403 |
hogHatViewController.selectedHog = [indexPath row];
|
|
404 |
|
|
405 |
[self.navigationController pushViewController:hogHatViewController animated:YES];
|
|
406 |
}
|
|
407 |
|
|
408 |
|
|
409 |
#pragma mark -
|
|
410 |
#pragma mark Memory management
|
|
411 |
-(void) didReceiveMemoryWarning {
|
|
412 |
// Releases the view if it doesn't have a superview.
|
|
413 |
[super didReceiveMemoryWarning];
|
|
414 |
// Relinquish ownership any cached data, images, etc that aren't in use.
|
|
415 |
if (hogHatViewController.view.superview == nil)
|
|
416 |
hogHatViewController = nil;
|
|
417 |
if (gravesViewController.view.superview == nil)
|
|
418 |
gravesViewController = nil;
|
|
419 |
if (voicesViewController.view.superview == nil)
|
|
420 |
voicesViewController = nil;
|
|
421 |
if (fortsViewController.view.superview == nil)
|
|
422 |
fortsViewController = nil;
|
|
423 |
if (flagsViewController.view.superview == nil)
|
|
424 |
flagsViewController = nil;
|
|
425 |
if (levelViewController.view.superview == nil)
|
|
426 |
levelViewController = nil;
|
|
427 |
}
|
|
428 |
|
|
429 |
-(void) viewDidUnload {
|
|
430 |
self.teamDictionary = nil;
|
|
431 |
self.textFieldBeingEdited = nil;
|
|
432 |
self.teamName = nil;
|
|
433 |
self.normalHogSprite = nil;
|
|
434 |
self.secondaryItems = nil;
|
|
435 |
hogHatViewController = nil;
|
|
436 |
flagsViewController = nil;
|
|
437 |
fortsViewController = nil;
|
|
438 |
gravesViewController = nil;
|
|
439 |
levelViewController = nil;
|
|
440 |
[super viewDidUnload];
|
|
441 |
MSG_DIDUNLOAD();
|
|
442 |
}
|
|
443 |
|
|
444 |
-(void) dealloc {
|
|
445 |
[teamDictionary release];
|
|
446 |
[textFieldBeingEdited release];
|
|
447 |
[teamName release];
|
|
448 |
[normalHogSprite release];
|
|
449 |
[secondaryItems release];
|
|
450 |
[hogHatViewController release];
|
|
451 |
[fortsViewController release];
|
|
452 |
[gravesViewController release];
|
|
453 |
[flagsViewController release];
|
|
454 |
[levelViewController release];
|
|
455 |
[super dealloc];
|
|
456 |
}
|
|
457 |
|
|
458 |
|
|
459 |
@end
|
|
460 |
|