Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

falseblackbear

macrumors newbie
Original poster
Apr 6, 2010
17
0
I am getting error message:
Redefinition of '[RootViewController tableViewdidSelectRowAtIndexPath:]

this is my



Code:
 - (void)viewDidLoad {
    [super viewDidLoad];
	
	tableList = [[NSMutableArray alloc] init];
	[tableList addObject:@"Red Line"];
	[self setTitle:@"Lines"];
	 

#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 [tableList 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];
    }
    
	[cell setText:[[tableList objectAtIndex:indexPath.row] retain]];

    return cell;
}



// Override to support conditional editing of the table view.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    if ([[tableList objectAtIndex:indexPath.row] isEqual:@"Red Line"])
	{
		secondviewcontrol *second = [[secondviewcontrol alloc] initWithNibName:@"secondviewcontrol.h" bundle:nil];
		[second setTitle:@"Red Line"];
		[self.navigationController pushViewController:second animated:YES];
	}

#pragma mark -
#pragma mark Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

my error occurs in the last line of code
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.