Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
805 - 1
//
2
//  MIxerViewController.m
3
//  iKopter
4
//
5
//  Created by Frank Blumenberg on 03.07.10.
6
//  Copyright 2010 de.frankblumenberg. All rights reserved.
7
//
8
 
9
#import "MixerViewController.h"
10
#import "MixerTableViewCell.h"
11
 
12
@implementation MixerViewController
13
 
14
@synthesize loadCell;
15
 
16
#pragma mark -
17
#pragma mark Initialization
18
 
19
/*
20
 - (id)initWithStyle:(UITableViewStyle)style {
21
 // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
22
 if ((self = [super initWithStyle:style])) {
23
 }
24
 return self;
25
 }
26
 */
27
 
28
 
29
#pragma mark -
30
#pragma mark View lifecycle
31
 
32
/*
33
 - (void)viewDidLoad {
34
 [super viewDidLoad];
35
 
36
 // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
37
 // self.navigationItem.rightBarButtonItem = self.editButtonItem;
38
 }
39
 */
40
 
41
/*
42
 - (void)viewWillAppear:(BOOL)animated {
43
 [super viewWillAppear:animated];
44
 }
45
 */
46
/*
47
 - (void)viewDidAppear:(BOOL)animated {
48
 [super viewDidAppear:animated];
49
 }
50
 */
51
/*
52
 - (void)viewWillDisappear:(BOOL)animated {
53
 [super viewWillDisappear:animated];
54
 }
55
 */
56
/*
57
 - (void)viewDidDisappear:(BOOL)animated {
58
 [super viewDidDisappear:animated];
59
 }
60
 */
61
/*
62
 // Override to allow orientations other than the default portrait orientation.
63
 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
64
 // Return YES for supported orientations
65
 return (interfaceOrientation == UIInterfaceOrientationPortrait);
66
 }
67
 */
68
 
69
 
70
#pragma mark -
71
#pragma mark Table view data source
72
 
73
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
74
  // Return the number of sections.
75
  return 1;
76
}
77
 
78
 
79
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
80
  // Return the number of rows in the section.
81
  return 12;
82
}
83
 
84
 
85
// Customize the appearance of table view cells.
86
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
87
 
88
  MixerTableViewCell *cell = (MixerTableViewCell *)[tableView dequeueReusableCellWithIdentifier:[MixerTableViewCell reuseIdentifier]];
89
  if (cell == nil)
90
  {
91
    NSLog(@"Loading new cell");
92
    [[NSBundle mainBundle] loadNibNamed:@"MixerTableViewCell" owner:self options:nil];
93
    cell = loadCell;
94
    self.loadCell = nil;
95
  }
96
  cell.cellLabel.text = [NSString stringWithFormat:@"Motor %d", [indexPath row]];
97
  return cell;
98
}
99
 
100
 
101
/*
102
 // Override to support conditional editing of the table view.
103
 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
104
 // Return NO if you do not want the specified item to be editable.
105
 return YES;
106
 }
107
 */
108
 
109
 
110
/*
111
 // Override to support editing the table view.
112
 - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
113
 
114
 if (editingStyle == UITableViewCellEditingStyleDelete) {
115
 // Delete the row from the data source
116
 [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];
117
 }  
118
 else if (editingStyle == UITableViewCellEditingStyleInsert) {
119
 // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
120
 }  
121
 }
122
 */
123
 
124
 
125
/*
126
 // Override to support rearranging the table view.
127
 - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
128
 }
129
 */
130
 
131
 
132
/*
133
 // Override to support conditional rearranging of the table view.
134
 - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
135
 // Return NO if you do not want the item to be re-orderable.
136
 return YES;
137
 }
138
 */
139
 
140
 
141
#pragma mark -
142
#pragma mark Table view delegate
143
 
144
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
145
  return nil;
146
}
147
 
148
#pragma mark -
149
#pragma mark Memory management
150
 
151
- (void)didReceiveMemoryWarning {
152
  // Releases the view if it doesn't have a superview.
153
  [super didReceiveMemoryWarning];
154
 
155
  // Relinquish ownership any cached data, images, etc that aren't in use.
156
}
157
 
158
- (void)viewDidUnload {
159
  // Relinquish ownership of anything that can be recreated in viewDidLoad or on demand.
160
  // For example: self.myOutlet = nil;
161
}
162
 
163
 
164
- (void)dealloc {
165
  [loadCell release];
166
 
167
  [super dealloc];
168
}
169
 
170
 
171
@end
172