Source code:
#import "TableViewTestAppDelegate.h"
@implementation TableViewTestAppDelegate
@synthesize window;
- (void)applicationDidFinishLaunching:(UIA pplication *)application {
contentArray = [[NSArray arrayWithObjects:@"First", @"Second", @"Third", nil] retain];
[window addSubview:[mainNavController view]];
}
- (NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:(NSInteger)section
{
return [contentArray count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *identity = @"MainCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identi ty];
if(cell == nil)
{
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:identity] autorelease];
}
cell.text = [contentArray objectAtIndex:indexPath.row];
return cell;
}
- (void)dealloc {
[window release];
[super dealloc];
}
@end


