views:

266

answers:

0

Hi there,

When I navigate from the root view to another view, it works. However, when I want to get back, the navigation button links to itself. This goes on for about 6 taps, until it eventually goes back to the root view.

This only occurs on one view, and the rest are working fine.

I have no idea what code is causing this, but if you need any code, I will amend this post with it. Just ask for it.

Thanks a lot, Jack.

Pushing the view (in rootviewcontroller.m)

In didSelectRowAtIndexPath method

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

    //CSS
    if ([[arryClientSide objectAtIndex:indexPath.row] isEqual:@"CSS"])
    {
        CSSViewController *css = [[CSSViewController alloc] initWithNibName:@"CSSViewController" bundle:nil];
        [css setTitle:@"CSS"];
        [self.navigationController pushViewController:css animated:YES];
    }

    //HTML
    if ([[arryClientSide objectAtIndex:indexPath.row] isEqual:@"HTML"])
    {
        HTMLViewController *html = [[HTMLViewController alloc] initWithNibName:@"HTMLViewController" bundle:nil];
        [html setTitle:@"HTML"];
        [self.navigationController pushViewController:html animated:YES];
    }


    //Apache
    if ([[arryServerSide objectAtIndex:indexPath.row] isEqual:@"Apache"])
    {
        ApacheViewController *apache = [[ApacheViewController alloc] initWithNibName:@"ApacheViewController" bundle:nil];
        [apache setTitle:@"Apache"];
        [self.navigationController pushViewController:apache animated:YES];
    }

    //JS
    if ([[arryClientSide objectAtIndex:indexPath.row] isEqual:@"JavaScript"])
    {
        JSViewController *js = [[JSViewController alloc] initWithNibName:@"JSViewController" bundle:nil];
        [js setTitle:@"JavaScript"];
        [self.navigationController pushViewController:js animated:YES];
    }

    //PHP
    if ([[arryServerSide objectAtIndex:indexPath.row] isEqual:@"PHP"])
    {
        PHPViewController *php = [[PHPViewController alloc] initWithNibName:@"PHPViewController" bundle:nil];
        [php setTitle:@"PHP"];
        [self.navigationController pushViewController:php animated:YES];
    }

    //SQL
    if ([[arryServerSide objectAtIndex:indexPath.row] isEqual:@"SQL"])
    {
        SQLViewController *sql = [[SQLViewController alloc] initWithNibName:@"SQLViewController" bundle:nil];
        [sql setTitle:@"SQL"];
        [self.navigationController pushViewController:sql animated:YES];
    }

    //HTML Colour Codes
    if ([[arryResources objectAtIndex:indexPath.row] isEqual:@"HTMLColourCodes"])
    {
        HTMLColourViewController *htmlcol = [[HTMLColourViewController alloc] initWithNibName:@"HTMLColourViewController" bundle:nil];
        [htmlcol setTitle:@"Colours"];
        [self.navigationController pushViewController:htmlcol animated:YES];
    }

    //Useful Resources
    if ([[arryResources objectAtIndex:indexPath.row] isEqual:@"Useful Resources"])
    {
        UsefulViewController *useful = [[UsefulViewController alloc] initWithNibName:@"UsefulViewController" bundle:nil];
        [useful setTitle:@"Resources"];
        [self.navigationController pushViewController:useful animated:YES];
    }

    //About
    if ([[arryResources objectAtIndex:indexPath.row] isEqual:@"About"])
    {
        AboutViewController *about = [[AboutViewController alloc] initWithNibName:@"AboutViewController" bundle:nil];
        [about setTitle:@"About"];
        [self.navigationController pushViewController:about animated:YES];
    }