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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:04:34+00:00 2026-06-04T13:04:34+00:00

I would like to develop an application where the main Window would have a

  • 0

I would like to develop an application where the main Window would have a NSTabView with several NSTabViewItems, and in each item it will have a different NSTableView.

How would you organize the class architecture in order to be able to access from each tab tableview controller to the others? What is the best way to do it?

I have read a lot of stuff about passing data between controllers using delegates and so on, but I think there must be another clearer way to do address this problem.

Having the next example scenario:

TabOneController.h

@interface TabOneController : NSControl {
    NSMutableArray *listOne;
        ...
}

TabTwoController.h

@interface TabTwoController : NSControl {
    NSMutableArray *listTwo;
        ...
}

These two controllers implements NSTableView dataSource and delegate methods using its NSMutableArray list for it. I would like a proper scenario where both controllers could have access to each other (class methods, View Controller, another controller managing all or whatever a good idea would fit here). What do you think it is the best way for it?

Thanks in advance

  • 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-04T13:04:35+00:00Added an answer on June 4, 2026 at 1:04 pm

    If you want to share data between controllers, a good solution is to pass all controllers the same instance of the data object. If there’s more data to be shared or if there’s some extra functionality attached to the data, wrap it in a model class and let the controllers share a pointer to the same model.

    If you want the controllers to call each other, there are many possibilities with different implications and there is no definitive answer, everything depends on the situation. The important question is: why would all the tab controllers want to access other tab controllers? Generally you should keep the controllers isolated. This is called loose coupling and it’s very good for your design.

    If the controllers need to call each other, try to rethink the design. Maybe some of the behaviour should go to the model instead? For example, instead of calling another controller to delete an item from a list, you can move the deletion code to the model, and other interested controllers can learn about the model changes by observing the model.

    Whatever you do, just don’t use singletons 🙂 I have put some sample code on GitHub that shows how to wire a project without (mis)using singletons.

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

Sidebar

Related Questions

I would like to develop an Android application which will have a local database.
I would like to develop a application (i prefer c++), which will take C
I would like to develop an application that will receive pictures from a camera
I would like to develop an iPhone application, but I do not have a
I would like to develop Mono application for Win/Linux/Mac in C# on Windows. Is
As described in the title I would like to develop a Windows Forms Application
i would like to know if i can develop a OpenSocial based application for
I need to develop a classic asp application on vista, and would like to
I would like to develop a desktop application to interact with the facebook API.
I would like to develop a poker odds application that can give the probability

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.