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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:35:19+00:00 2026-06-14T08:35:19+00:00

This question is in reference to an iPhone app which uses Xcode’s Master Detail

  • 0

This question is in reference to an iPhone app which uses Xcode’s Master Detail template with Core Data. The app supports iOS 5.1 and above.

I’m using NSFetchedResultsController to manage the items in a UITableView which is the second view controller in my UINavigationController stack. The user selects from the table view and the third view controller in the stack is pushed onto the view. Pretty standard stuff, and I’m enjoying the much simplified access to Core Data objects afforded by the NSFetchedResultsController.

Once in the third view controller, the user is looking at a set of data selected from the list in the table view. I have added a couple of buttons to this view for navigating to the previous or next set of data. Think of the iOS Mail app and the up/down buttons you see when looking at an email. You can use these buttons to select the next or previous email in the list, without navigating back to the list (table view) of emails.

I tried to find the simplest method for identifying which data should be loaded from the data store when one of these next/previous buttons is tapped. As far as I can tell, this is to use the fetched results controller from the previous view controller in the stack. I can simply ask Core Data to return the results for the next or previous index path in the table view.

While in my third (Detail) view controller I’m able to get access to the second (Master) view controller’s fetched results controller as follows:

NSFetchedResultsController *fetch = [[self.navigationController.viewControllers objectAtIndex:1] fetchedResultsController];
NSIndexPath *indexPath = [fetch indexPathForObject:self.detailItem];
NSLog(@"Section: %d, Row: %d", indexPath.section, indexPath.row);

Before I go any further, I need to know that view controller and its fetched results controller will always be around. As I understand it, it will be retained until there is a shortage of memory, at which point it could be released. My detail views can consume a lot of memory when displaying their data, and will consume more and more as the app is used to gather more data over time.

Can I be sure these items (previous view controller in the stack and its fetched results controller) will stay in memory while my user is interacting with the detail view controller?

If not, is there a way for me to ensure they are retained?

Otherwise, is there a simpler or more elegant way for me to achieve the aim?

  • 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-14T08:35:20+00:00Added an answer on June 14, 2026 at 8:35 am

    Your second view controller will never be released. Also not during low memory situations. What can happen is that viewDidUnload (deprecated and no longer called in iOS 6) is called in low memory situations. So as long as you don’t get rid of your NSFetchedResultsController in that method you should be fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wanting to build an app with 2 core data handlers for one iphone
In reference to the following question: iPhone: How do I detect when an app
I have core data configuration in my iPhone app, and how I'm currently passing
I've taken reference from this SO question about how to detect inactivity of App
With the reference to this question:- JavaScript -Change CSS color for 5 seconds Working
In reference with this question We have a header with a date picked component
EDIT: This question is about finding definitive reference to MySQL syntax on SELECT modifying
Somebody ask me this question today . What is the need of reference in
I'm using Alberto Santini's solution to this question to get a spiral grid reference
This is with reference to the below question: Execute program from within a C

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.