tags:

views:

72

answers:

1

I have a tabbed bar main window with four tabs, one of which is a list. This list is empty at first but when I click a "+" I am presented with a modal view of available options like this

- (IBAction)addThing:(id)sender {
    MJAvailableThingsViewController *controller = [self availableThingsViewController];
    [self presentModalViewController:availableThingsViewController animated:YES];
    [controller setEditing:YES animated:NO];
}

This works.

The list of things has a UITableViewCellAccessoryDetailDisclosureButton on each row. This was done with the accessoryTypeForRowWithIndexPath. This works as well.

When I click the little blue button in this view the delegate accessoryButtonTappedForRowWithIndexPath is called. This works.

However, in accessoryButtonTappedForRowWithIndexPath I want to present a detail view of the thing and this is where I encounter problems:

The delegate looks like this:

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath;
{
    NSLog(@"accessoryButtonTappedForRowWithIndexPath");
    NSLog(@"Tapped row %d", [indexPath row]);

    [[self navigationController] pushViewController:thingDetailViewController animated:YES];

The program enters this code but nothing happens, that is I get the NSLog output but no new window. I am very new at this so please forgive me if this is obvious; to me it is, however, not... :-)

A: 

Do you have a navigationController? It sounds like you have a TabController but not a NavigationController.

Check [self navigationController], is it set to anything?

Here's a similar question:
http://stackoverflow.com/questions/369128/tab-bar-application-with-navigation-controller

marcc
No, I don't have a navigationcontroller. The question you pointed me to is indeed very similar to my problem but I have not been able to use the advice therein, mainly due to inability. Bother.My latest attempt rendered me a view with just a table for availableThings, instead of the table with a title bar on top and the add button I used to have.