Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8358793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:55:06+00:00 2026-06-09T10:55:06+00:00

I am new in iOS development. I created an App using Storyboard to navigate

  • 0

I am new in iOS development. I created an App using Storyboard to navigate to different pages.

enter image description here

When I click on the Add BarButton in Customer page –> go to the Add Customer Page.(using Modal Storyboard Segue)

There, when I enter username and password and click on save button –> come back to Customer page.

And everything works fine.

The problem is I want to have back button in Add Customer page. I already know that I can use Push Storyboard Segue, but when I use it I face with an error:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported'
*** First throw call stack:
(0x13cb022 0x155ccd6 0xeff1b 0xefa24 0x44bde6 0x4404d0 0x13cce99 0x1814e 0x256a0e 0x13cce99 0x1814e 0x180e6 0xbeade 0xbefa7 0xbe266 0x3d3c0 0x3d5e6 0x23dc4 0x17634 0x12b5ef5 0x139f195 0x1303ff2 0x13028da 0x1301d84 0x1301c9b 0x12b47d8 0x12b488a 0x15626 0x25ed 0x2555)
terminate called throwing an exception(lldb) 

CustomerViewController.h:

#import "AddCustomerViewController.h"
    @interface CustomerViewController : UITableViewController<AddCustomerViewControllerDelegate>
    {
        IBOutlet UITableView *tableview;
        NSMutableArray *customers;
    }

    @property(nonatomic,retain)IBOutlet UITableView *tableview;
    @property(nonatomic,retain)NSMutableArray *customers;

    @end

This is the code I use in CustomerViewController.m:

self.customers = [[NSMutableArray alloc]init]; 

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if([segue.identifier isEqualToString:@"AddCustomer"])
    {
        UINavigationController *navigationController = segue.destinationViewController;
        AddCustomerViewController *addCustomerViewController = [[navigationController viewControllers] objectAtIndex:0];
        addCustomerViewController.delegate = self;
    }
}

-(void) addCustomerViewControllerDidSave: (AddCustomerViewController *) Controller newCustomer: (Customer *) customer
{
    [self dismissViewControllerAnimated: YES completion:NULL];
    [self.customers addObject:customer];
    [self.tableview reloadData];
}

AddCustomerViewController.h:

#import "Customer.h"

@class AddCustomerViewController;

@protocol AddCustomerViewControllerDelegate <NSObject>

-(void) addCustomerViewControllerDidSave: (AddCustomerViewController *) Controller newCustomer: (Customer *) customer;

@end

@interface AddCustomerViewController : UITableViewController
{

}

@property (nonatomic, weak) id <AddCustomerViewControllerDelegate> delegate;

@property (nonatomic, strong) IBOutlet UITextField *firstnameTxt;
@property (nonatomic, strong) IBOutlet UITextField *lastnameTxt;

- (IBAction)save:(id)sender;

@end

And AddCustomerViewController.m:

- (void)save:(id)sender 
{
    NSLog(@"Save");
    Customer *newCustomer = [[Customer alloc]init];
    newCustomer.firstname = self.firstnameTxt.text;
    newCustomer.lastname = self.lastnameTxt.text;
    [self.delegate addCustomerViewControllerDidSave:self newCustomer:newCustomer];

}

Can you help me how can I use Push Storyboard Segue (to have back button) ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:55:07+00:00Added an answer on June 9, 2026 at 10:55 am

    First of all, get rid of the second navigation controller like what everybody here are saying.

    Then, in storyboard, connect the “+” button directly to Add Customer View Controller and set the segue as push.

    Next, click on the navigation bar of Customer view controller, in the attributes inspector where you should have defined the title (“Customer”) for this view, there should be a “Back Button” row. Type “Back” and you will get a Back button in Add Customer view controller.

    In prepareForSegue,

    if([segue.identifier isEqualToString:@"AddCustomer"])
    {    
        AddCustomerViewController *addCustomerViewController = segue.destinationViewController;
        addCustomerViewController.delegate = self;
    }
    

    To close Add Customer View controller, use popViewControllerAnimated as follows:

    -(void) addCustomerViewControllerDidSave: (AddCustomerViewController *) Controller newCustomer: (Customer *) customer
    {
        [self.customers addObject:customer];
        [self.tableview reloadData];
        [self.navigationController popViewControllerAnimated:YES];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am fairly new to iOS development and trying make a simple app which
Short Introduction I am kind of new in the field of app development using
I am new to iOS development so please bear with me. I have created
Using my FB account I created an FB app for use by an iOS
I'm very new with iOS Development and I have just created one of my
I'm new to iOS development, I just have UITableViewController in a storyboard. I would
I'm new to iOS development, just had a quick question. I'm creating an app
I'm fairly new to iOS development, and I'm starting work on an App that
I am fairly new to iOS development, and currently an app I am creating
I am new in ios development. I am doing a photo cropper app. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.