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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:36:49+00:00 2026-05-25T19:36:49+00:00

I have an app I am working on. There is a navigation controller, and

  • 0

I have an app I am working on. There is a navigation controller, and my appDelegate is passing its managedObjectContext to the nav controllers root controller like so:

RootViewController *rootViewController = (RootViewController *)[navigationController topViewController];
rootViewController.managedObjectContext = self.managedObjectContext;

(Bonus question – I’ve read the above is the preferred way to pass the context, as opposed to some examples I see where the view controller grabs the context from the delegate – is this correct? Also, do I need to release rootViewController above, or am I correct in that it is autoreleased because it was not created using alloc or new?)

Anyway, the main view of the app has a button – when clicked, it records a timestamp and saves it in core data. The app then displays a second view, which is where the user is going to work with a subset of the data. This second view allows the user to choose to see all timestamps from the current week, month, or year.

My initial thought is to pass the managedObjectContext from the rootVC to the detailVC, and perform the data read and queries in the detailVC. Is this the proper way to go about this, or is it better to perform the query at the rootVC and pass the data to the detail controller as an array or something? Or does it make no difference other than organizationally (no performance difference) – 6 of one, half a dozen of the other?

  • 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-05-25T19:36:49+00:00Added an answer on May 25, 2026 at 7:36 pm

    You don’t really have to worry about the efficiency of this, it will perform fine whichever way you do it – you’re just passing a pointer around. That’s not to say this is a decent way of going about things though.

    Apple’s Core Data templates are pretty terrible. Generally speaking, it’s better to factor out your data management into a separate manager class that has responsibility for managing your data.

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

Sidebar

Related Questions

I have a simple iPhone app based on a navigation controller. There are two
I have an app with a table view at the root in a navigation
In the iPhone app I'm currently working on, I'd like two view controllers (I'll
I am working on an app that has a navigation view controller in a
I'm using navigation controller for my app. In one of views I have an
I have an Eclipse RCP app I'm working on. It has some view-specific menus
I have an MFC app which I have been working on for a few
I have a new app I'll be working on where I have to generate
In an app I'm working on, I have a plain style UITableView that can
I'm adding repeating events to a Cocoa app I'm working on. I have repeat

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.