|
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 |
|
11 |
|
12 @implementation SingleTeamViewController |
|
13 |
|
14 |
|
15 #pragma mark - |
|
16 #pragma mark Initialization |
|
17 |
|
18 /* |
|
19 - (id)initWithStyle:(UITableViewStyle)style { |
|
20 // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. |
|
21 if ((self = [super initWithStyle:style])) { |
|
22 } |
|
23 return self; |
|
24 } |
|
25 */ |
|
26 |
|
27 |
|
28 #pragma mark - |
|
29 #pragma mark View lifecycle |
|
30 |
|
31 /* |
|
32 - (void)viewDidLoad { |
|
33 [super viewDidLoad]; |
|
34 |
|
35 // Uncomment the following line to preserve selection between presentations. |
|
36 self.clearsSelectionOnViewWillAppear = NO; |
|
37 |
|
38 // Uncomment the following line to display an Edit button in the navigation bar for this view controller. |
|
39 // self.navigationItem.rightBarButtonItem = self.editButtonItem; |
|
40 } |
|
41 */ |
|
42 |
|
43 /* |
|
44 - (void)viewWillAppear:(BOOL)animated { |
|
45 [super viewWillAppear:animated]; |
|
46 } |
|
47 */ |
|
48 /* |
|
49 - (void)viewDidAppear:(BOOL)animated { |
|
50 [super viewDidAppear:animated]; |
|
51 } |
|
52 */ |
|
53 /* |
|
54 - (void)viewWillDisappear:(BOOL)animated { |
|
55 [super viewWillDisappear:animated]; |
|
56 } |
|
57 */ |
|
58 /* |
|
59 - (void)viewDidDisappear:(BOOL)animated { |
|
60 [super viewDidDisappear:animated]; |
|
61 } |
|
62 */ |
|
63 |
|
64 |
|
65 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
|
66 // Override to allow orientations other than the default portrait orientation. |
|
67 return YES; |
|
68 } |
|
69 |
|
70 |
|
71 #pragma mark - |
|
72 #pragma mark Table view data source |
|
73 |
|
74 -(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { |
|
75 // Return the number of sections. |
|
76 return 3; |
|
77 } |
|
78 |
|
79 |
|
80 -(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { |
|
81 // Return the number of rows in the section. |
|
82 NSInteger rows; |
|
83 switch (section) { |
|
84 case 0: |
|
85 rows = 1; |
|
86 break; |
|
87 case 1: |
|
88 rows = 8; |
|
89 break; |
|
90 case 2: |
|
91 rows = 5; |
|
92 break; |
|
93 default: |
|
94 break; |
|
95 } |
|
96 return rows; |
|
97 } |
|
98 |
|
99 |
|
100 // Customize the appearance of table view cells. |
|
101 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
|
102 |
|
103 static NSString *CellIdentifier = @"Cell"; |
|
104 |
|
105 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; |
|
106 if (cell == nil) { |
|
107 cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; |
|
108 } |
|
109 |
|
110 // Configure the cell... |
|
111 |
|
112 return cell; |
|
113 } |
|
114 |
|
115 |
|
116 /* |
|
117 // Override to support conditional editing of the table view. |
|
118 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { |
|
119 // Return NO if you do not want the specified item to be editable. |
|
120 return YES; |
|
121 } |
|
122 */ |
|
123 |
|
124 |
|
125 /* |
|
126 // Override to support editing the table view. |
|
127 - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { |
|
128 |
|
129 if (editingStyle == UITableViewCellEditingStyleDelete) { |
|
130 // Delete the row from the data source |
|
131 [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES]; |
|
132 } |
|
133 else if (editingStyle == UITableViewCellEditingStyleInsert) { |
|
134 // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view |
|
135 } |
|
136 } |
|
137 */ |
|
138 |
|
139 |
|
140 /* |
|
141 // Override to support rearranging the table view. |
|
142 - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { |
|
143 } |
|
144 */ |
|
145 |
|
146 |
|
147 /* |
|
148 // Override to support conditional rearranging of the table view. |
|
149 - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { |
|
150 // Return NO if you do not want the item to be re-orderable. |
|
151 return YES; |
|
152 } |
|
153 */ |
|
154 |
|
155 |
|
156 #pragma mark - |
|
157 #pragma mark Table view delegate |
|
158 |
|
159 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
|
160 // Navigation logic may go here. Create and push another view controller. |
|
161 /* |
|
162 <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil]; |
|
163 // ... |
|
164 // Pass the selected object to the new view controller. |
|
165 [self.navigationController pushViewController:detailViewController animated:YES]; |
|
166 [detailViewController release]; |
|
167 */ |
|
168 } |
|
169 |
|
170 |
|
171 #pragma mark - |
|
172 #pragma mark Memory management |
|
173 |
|
174 - (void)didReceiveMemoryWarning { |
|
175 // Releases the view if it doesn't have a superview. |
|
176 [super didReceiveMemoryWarning]; |
|
177 |
|
178 // Relinquish ownership any cached data, images, etc that aren't in use. |
|
179 } |
|
180 |
|
181 - (void)viewDidUnload { |
|
182 // Relinquish ownership of anything that can be recreated in viewDidLoad or on demand. |
|
183 // For example: self.myOutlet = nil; |
|
184 } |
|
185 |
|
186 |
|
187 - (void)dealloc { |
|
188 [super dealloc]; |
|
189 } |
|
190 |
|
191 |
|
192 @end |
|
193 |