I am really confused about segues. There are so many different ways to change the current ViewController and I don't know which to use and mix them up.
What I currently have, is a MainViewController. On this I have 4 Buttons. The first button is connected with a Show (e.g Push) Segue. On the other side of the Segue is a Navigation Controller with a View Controller. Now this works with no additional code.
Now my first Question. The Navigation Controller will never be shown, right? Only the View Controller will be shown. But if I want to add a Navigation Item Button on the right side to go back to the first View Controller how should I do it? I need to add the button programmatic like this:
UIBarButtonItem *leftBackToPreviousScreenButton = [[UIBarButtonItem alloc]
initWithTitle:@""
style:UIBarButtonItemStylePlain
target:self
action:@selector(back)];
- (void)back
{
[self performSegueWithIdentifier:@"ExitEventOverview" sender:self];
}
Is this right?
Now the next step is, that I need to open another View to edit details of an event which are shown in the previous View as a table. When I click on the table row the Edit View should open and I need to pass the event object. How do I do this with segues? After finishing editing how can I add programmatic a Cancel and Save button to the Edit View do return to the Overview of all Events?