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 8609251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:50:23+00:00 2026-06-12T03:50:23+00:00

I have simple master and detail view controllers connected with two segues, one for

  • 0

I have simple master and detail view controllers connected with two segues, one for “show detail” and one for “add new”.

  • “Show detail” segues to the detail view controller with setEditing:NO.
  • Tap “+” (add icon) segues to the detail view controller with setEditing:YES

iOS 5.1: “+” works as I expect, the detail page is in edit mode and editingStyleForRowAtIndexPath fires to show the insert and delete indicators.

iOS 6.0: the “+” makes the transition to the detail page but editingStyleForRowAtIndexPath never fires. Other code that is in setEditing:YES gets executed. didSelectRowAtIndexPath does fire (delegate = self).

Once on the detail page edit mode works as expected in both cases.

Any ideas?

// Master.m
if([[segue identifier] isEqualToString:@"NewRecipe"]) {

    DetailViewController *detailViewController = [segue destinationViewController];
    // stuff
    detailViewController.recipe = r;     
    detailViewController.delegate = self;
    detailViewController.editing = YES;
}


// Detail.m
-(void)setEditing:(BOOL)flag animated:(BOOL)animated {

   if (flag) {

   [self.tableView setEditing:flag animated:YES];
   [self.tableView beginUpdates];
   // the row does get added
   [self.tableView insertRowsAtIndexPaths:@[pathToAdd] withRowAnimation:UITableViewRowAnimationAutomatic];  
    // datasource gets updated here
    [self.tableView endUpdates];
    .... 
    }
}
  • 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-12T03:50:24+00:00Added an answer on June 12, 2026 at 3:50 am

    I figured it out. I don’t know why this is the fix, I hope this does not replace bad code with worse code.

     Master.m
    // iOS 5 -- this is OK
    detailViewController.editing = YES;
    

    For iOS 6 I needed the detailViewController to make a call to a delegate method to determine whether to setEditing:YES.

    Master.m
    -(BOOL)isNewRecipe {
        return (_isNewRecipe == 1);
    }
    
    Detail.m
    if ([self.delegate isNewRecipe]) {
        [self setEditing:YES];        
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple master-detail application and I'm using the detail view to configure
I have a simple iOS Master-Detail Application -> On the iPad it's a splitview,
Look, I have these pretty simple model Master-Detail: Hand is master of Fingers (finger
I have a simple Master-Detail application with a MasterViewController and a DetailViewController. Inside of
Let's say I have a simple application. It tries to add a new entry
How can I detect back in my mapview (master) controller that the detail view
I have a simple WPF program using the Master-Detail UI pattern, where the Detail
I have a simple website with a master-page. To set properties to elements on
I have a simple Git repo with non-branching commits in the master branch. I
on my master page, I have referenced jquery file. I am doing simple hover

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.