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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:33:43+00:00 2026-06-18T08:33:43+00:00

I have a very general question regarding MVCs. I have an app which uses

  • 0

I have a very general question regarding MVCs. I have an app which uses tab bar controller to show different kinds of data from a web service.

I have a “model” class which does all the dirty work like fetching data and modifying it for presentation, but I’m instancing that class in each MVC. And here is where the trouble comes. For example, two of the tabs of the app are Sales and Comments. When the app launches I want it to fetch and display Sales, and also fetch Comments and put a badge on the comments tab if there are new comments.

That fetching process involves pulling data from a web service, storing it to core data, pulling from cache, comparing, etc etc. And it gets ugly when the user taps Comments, but they are still fetching in the Sales tab (just for that badge). And when Comments comes up, Sales MVC is dead and I can’t tell it anything to prevent it from screwing up.

My question is, how can I make the “brain” class independent from the MVCs? Meaning that I don’t want to have a brain for each MVC (which doesn’t make sense), but only one for all MVCs and use delegation to push data and badges and stuff? I have thought about subclassing the UITabBarController and stick the brain class there, but I’m not sure if it’s a good practice to do it like this.

Any thoughts?

  • 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-18T08:33:44+00:00Added an answer on June 18, 2026 at 8:33 am

    There is absolutely no problem with subclassing of UITabBarController.
    Just go ahead and place fetch logic there. After fetching, you can update tab controllers and tab badges.

    P.S. In my app I just simply placed logic in first tab controller, and then updated other tab controllers accessing it like self.tabBarController.tabBar.items[1].

    Also, I added to tab controllers other than first:

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(contextDidChange:)
                                                 name:NSManagedObjectContextObjectsDidChangeNotification
                                               object:self.managedObjectContext];
    

    and looking for core data changes:

    - (void)contextDidChange:(NSNotification *)notification
    {
        dispatch_async(dispatch_get_main_queue(), ^{
    
            NSLog(@"%s",__PRETTY_FUNCTION__);
    
            assert([NSManagedObjectContextObjectsDidChangeNotification isEqual:notification.name]);
            for (NSManagedObject *mo in [notification.userInfo objectForKey:NSUpdatedObjectsKey])
            {
                if ([mo isKindOfClass:[Place class]]) {
             ...
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very general question regarding the use of LINQ vs SQL to
All, I have a very general question regarding a future project. I need to
This is a very general question regarding GAE / Java Memcache : I have
I have a very general question about unix. After using the ls command in
I'm starting to study GWT now, and have a very general question, I could
I have some question regarding database performance in general. I'm using Sqlite but I
I'm very new to asp.net and I have a general question about datalists. I
I have a very general question and have prepared a simple test case. When
I have a general question regarding bundles, libraries and custom frameworks on the iOS.
I have a very general web page where I display information. I have this

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.