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

The Archive Base Latest Questions

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

I have a few entities which are managed by custom NSManagedObject classes. They are

  • 0

I have a few entities which are managed by custom NSManagedObject classes. They are being listed in different view controllers. Managed object subclasses have common abstract superclass which holds common attributes (let’s say its title as NSString and favorite as BOOL). I have view controller for favorites which lists, well.. all entities with favorite attribute as true. Since favorites have different classes – is it normal to derive (or get) the view controller class from appropriate subclass of abstract superclass of those managed objects? Am I breaking the MVC here?

Update

Some clarification for sergio: Let’s say I have abstract superclass Animal and subclasses like Cat, Dog. Instances of these represent individual animals (like animals with names). Then I have CatsViewController and DogsViewController. They list instances of appropriate Animal subclass. I also have CatDetailsViewController and DogDetailsViewController which represent single instances of managed objects. Then I have FavoritesViewController which lists both – cats & dogs in a table. Upon a tap of a row I want to take the user to appropriate CatDetail or DogDetail view controller. This where the question comes – can I derive/get the class of view controller from the instance of managed object. I am also open to other options of realizing this.

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

    EDIT (after comment):

    This is perfectly MVC compliant, IMO. Your FavoritesViewController is in charge of telling which object you are dealing with and invoking the right specific controller (CatDetail or DogDetail view controller). It still embeds knowledge about the business logic of your app and model and views are properly separated from it. You see, in the end, between FavoritesViewController and DogsViewController/CatsViewController there is not much difference; the only difference is that FavoritesViewController knows about two types of data instead on only one.

    OLD ANSWER:

    I am not sure I understand fully your scenario, but from what I understand, I would say that you are maybe breaking a little the principle of encapsulation; then, it comes down to how you are doing it, i.e., if you use a factory, or how do you instantiate your specific controller base on model information.

    As to the MVC, I think you are not breaking it specifically. As long as a “controller” is in charge of creating your specific controller classes, you are playing within its boundaries.

    Well, take this with a grain of salt, since I have only a very partial understanding of what you are doing. In any case, hope it helps.

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

Sidebar

Related Questions

I have few different applications among which I'd like to share a C# enum.
Say I have a core data model with a few entities and, throughout the
I have few Question for which I am not able to get a proper
I'm experimenting with .Net RIA and Silverlight, I have a few of related entities;
I have a Silverlight 4 app which pulls entities down from a database using
I have a few tables representing geographical entities ( CITIES , COUNTIES , ZIPCODES
I have a large list of entities which the user needs to be able
I have a few hundred keys, all of the same Model, which I have
I have a generic model framework with a few entities and relationships that I'd
In our game (targeted at mobile) we have a few different entity types and

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.