#import "RootViewController.h"
#import "MethodController.h"


@implementation RootViewController


#pragma mark -
#pragma mark View lifecycle


- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"CA Classes";
    classArray = [[NSArray alloc] initWithObjects:@"CAAnimation", @"CAConstraint", @"CALayer", 
                  @"CAMediaTimingFunction", @"CATransaction", @"CAAnimationGroup", @"CAPropertyAnimation", @"CATransition"
                  @"CABasicAnimation", @"CAKeyframeAnimation",
                  @"CAEAGLLayer", @"CAScrollLayer", @"CATiledLayer", @"CATextLayer",
                  @"CARenderer",nil];

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
     self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
	// Return YES for supported orientations.
 return YES;//(interfaceOrientation == UIInterfaceOrientationPortrait);
}
 


#pragma mark -
#pragma mark Table view data source

// Customize the number of sections in the table view.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}


// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [classArray count];
}


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }
    
	// Configure the cell.
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.textLabel.text = [classArray objectAtIndex:indexPath.row];

    return cell;
}

#pragma mark -
#pragma mark Table view delegate

-   (void)    tableView:(UITableView *)tableView 
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
	
	 MethodController *detailViewController = [[MethodController alloc] init];
	 [self.navigationController pushViewController:detailViewController animated:YES];
	 [detailViewController release];
	 
}

@end

