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

  • Home
  • SEARCH
  • 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 8368769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:27:57+00:00 2026-06-09T13:27:57+00:00

I have an item detail view which I would like to use for two

  • 0

I have an item detail view which I would like to use for two purposes:

1) to create a new item
2) to edit an existing item

When editing, the view will be pushed onto the navigation stack, getting the nav bar from it’s parent.

On item creation, I want to present the view modally, but still have a navigation bar at the top, with “Done” and “Cancel” buttons.

What I don’t want is to ever see the view with two nav bars, or none.

How would I implement this?

  • 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-09T13:27:59+00:00Added an answer on June 9, 2026 at 1:27 pm

    In order to accomplish this I:

    Removed the nav bar from my view.
    When launching modally, first created a nav controller, and then displayed the nav controller modally with my view as the root view (even though I didn’t plan on pushing anything else onto the stack). So changed this:

    StoreDetailView *storeDetailView = [[StoreDetailView alloc] initWithNibName:@"StoreDetailView" bundle:nil];
    // ... configure the view, including setting delegate...
    [self presentViewController:storeDetailView animated:YES completion: nil];
    

    to this:

    StoreDetailView *storeDetailView = [[StoreDetailView alloc] initWithNibName:@"StoreDetailView" bundle:nil];
    // ... configure the view, including setting delegate...
    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:storeDetailView];
    [self presentViewController:navController animated:YES completion: nil];
    

    And then in the StoreDetailView, determined what the nav bar should look like based on whether the delegate was set:

    if (self.delegate == nil) {
        self.navigationItem.rightBarButtonItem = [self editButtonItem];
    } else {
        [self setEditing:TRUE];
        self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(done:)];
        self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel:)];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of items with which I would like to view more
I have product item webpages located in /product/items/*.html?id=12345&ref=54321 and I would like the webpages
On a detail view I'm trying to pull the navigation item's title which is
I have the following code on the Table detail view of the table which
I have a model inside a strongly typed view but I would like there
I have a couple of rows in a table view which I like to
I have a View in my MVC3 application which displays one of two pretty
I have an Item class. There's an itemType field inside of that class which
I have details view control in my asp.net web form, which on of its
I have a TabActivity with a tab, which shows a list. I'd like to

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.