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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:49:29+00:00 2026-05-15T23:49:29+00:00

Using Apple’s Mail application as an example; pretend it uses Core Data. When you

  • 0

Using Apple’s Mail application as an example; pretend it uses Core Data. When you touch an email account, it shows you all the messages in that account. So the controller did a fetch request for all the messages in that account.

Then you touch a message and drill one level deeper, now you are viewing a single message. This single message was probably passed from the message list controller, but — you can also click the triangles in the upper right to move through all the messages in the same email account. This means the view controller for viewing a single email message also needs the exact same list of messages.

So you could cut and paste the fetch request logic from the list view, but that isn’t DRY/don’t-repeat-yourself.

Any suggestions for a best practice in solving this problem?

  • 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-15T23:49:29+00:00Added an answer on May 15, 2026 at 11:49 pm

    The solution I’ve been using to solve this problem is to use the delegate design pattern. I.e., in an application with a rootViewController and a detailViewController, the rootViewController acts as a delegate for the detailViewController.

    So, for example, when the user is viewing an email message (on the detail view), and they click a button to iterate to new a message, then the detailViewController informs the rootViewController via a delegate method that the rootViewController needs to display a new message.

    This way, the detailViewController only every needs to know information about one model object (the email being displayed). While the rootViewController handles interaction that involve the rest of the objects.

    To me, this is a nice division of responsibility, so this is the solution I’ve been using.

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

Sidebar

Ask A Question

Stats

  • Questions 529k
  • Answers 529k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer When you search from your web app do you search… May 16, 2026 at 11:13 pm
  • Editorial Team
    Editorial Team added an answer Just use the survey list May 16, 2026 at 11:13 pm
  • Editorial Team
    Editorial Team added an answer The second variant is how Observer design pattern works. It… May 16, 2026 at 11:13 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am using Apple's CoreDataBooks sample project as a learning aid for core data.
i am using apple's sample URLCache ,but when i mention url, it loads data
I am re-using Apple's AdvancedTableViewCells example to create a custom, fast-scrolling tableview. Specifically, I
I'm using Apple Document to create an app.I succeed in connection to the server,
I am using Apple's page control sample and showing three different types of views.
Setting up SVN using Apple Developer Connection manual ( http://developer.apple.com/mac/articles/server/subversionwithxcode3.html ). Regardless of it,
I am using Apple's MyGizmoClass Singleton class for program-wide session variables and loving it!
I am using apple's custom table view cell code and modifying the drawRect code
I am using apple standard code for scrolling+zooming+paging after 10 image scrolling and paging
I using the project named coredatabooks from apple developer examples. #import @interface Book :

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.