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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:12:51+00:00 2026-06-12T12:12:51+00:00

I try to explain. Simple sample project, with a Person class managed, for example,

  • 0

I try to explain.
Simple sample project, with a Person class managed, for example, by Core Data.
I have many UITableViews that shows the data (one showing all persons, permitting to add, remove, update persons, another showing the middle age, another showing the persons grouped by same name…these are only some example, it doesn’t matter).
Sure, I don’t want to write the core data code inside all the viewcontrollers.
What would you do in a situation like this to write more maintainable code?

  • A singleton “PersonManager” class, with (for example) a mutableArray with all persons, insert-remove-update methods, a NSFetchedResultsController ecc ecc…

  • Class methods on the Person object? Something like “NSArray *array = [personObject allPersons];” and methods add-remove-update? The class knows how to load itself from memory ecc ecc…?

Or what?

Thank you
Fabio

  • 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-12T12:12:52+00:00Added an answer on June 12, 2026 at 12:12 pm

    I once read a very good book on design patters and OOP which stated that every class that you make and are tempted to call it “manager” is rubbish. I can’t remember the book, but it matters less. The point is, every data object should be able to manage itself and manage its relationships (for example a person object could have an addFather: or addFriend: method). And a Core Data tip: use categories to implement additional methods to the automatically generated data object classes, it will make your life much easier when you add new relations or properties in Core Data.

    So, in your case, you would need a data object that has all persons tied to it. You can call it AgendaDO or whatever. This object will have methods to add, remove persons, but also to get all the persons in a specific order, to sort only specific persons and so on.

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

Sidebar

Related Questions

I'll try to explain what I want. I have a PHP script that send
I will try to explain a simple app scenario: My app goes right to
I try to explain my problem. I have a first view in which I
Let me try to explain by example. Say website is hosted at example.com (NOT
I'll try to explain shortly what I want to do: A project using a
I'll try to explain this with an example. I'm writing a chat application. There
I'm working on a C project that consists of a simple game using the
I'm going to try to explain this in simple terms, because it's probably shorter
Okay this might sound simple but there's a catch. I'll try and explain the
I will try to explain this very simple. So, I skipped any code which

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.