mcw
mcw

Reputation: 545

iOS - view from table view won't display nav bar

So I have a navigation controller leading to a table view, which leads to a detail view. There is an add button leading to another table view to choose from a contacts list. When I select DONE, I want to lead to a new detail view, but the navigation bar won't display. Below is an image of the IB:

image of IB

So I want to move from the Contacts View Controller to the Convo View Controller but keep the navigation item working.

The code that is executed when the DONE button is pressed:

- (IBAction)doneButtonPressed:(UIBarButtonItem *)sender {
   BOOL sharing = NO;
   if ([self.referrer isEqualToString:@"mapView"]) sharing = YES;
   Convo *newConvo = [[Convo alloc] initWithMembers:self.selectedContacts 
                                                             sharing:sharing];
   // add newConvo to convos list

   ConvoViewController *convoVC = [self.storyboard   
                        instantiateViewControllerWithIdentifier:@"convoView"];
   convoVC.convo = newConvo;
   NSLog(@"%@", [convoVC.convo memberListToString]);
   [self presentViewController:convoVC
                      animated:YES
                    completion:nil];
}

Thank you for any help!

Upvotes: 0

Views: 81

Answers (1)

rdelmar
rdelmar

Reputation: 104082

I would do what you're trying to do, by embedding the ContactsViewController in its own navigation controller, and segueing (from the Done button) to the new instance of ConvoViewController (the one with the title of "Contacts Detail"). In that controller I have a bar button item called "Main Table" that's connected to an unwind segue that unwinds back to MasterViewController. Here is the setup,

enter image description here

Upvotes: 1

Related Questions