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