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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:34:06+00:00 2026-05-29T09:34:06+00:00

Current Situation: Direct Binding I have an NSTableView which displays the data that comes

  • 0

Current Situation: Direct Binding

I have an NSTableView which displays the data that comes from an NSArray of my custom objects.

Desired Approach: Array Controller

However, It would be “more best practise” to use an NSArrayController instead as a facade to my arbritary model object.

So I duplicated the table in my application and created a new NSViewController where I bound the Table Content of the NSTableView to the NSArrayController. I added an IBOutlet for this class so I can now setup my View Controller like this:

ContactListViewController *myVC = [[ContactListViewController alloc] init];

// Tell the ArrayController where the content-array is.
myVC.contactsArrayController.content = self.myModel.contactsArray;

Now since I bound the Table Content of the table view to the array controller, I would expect, that as soon as I fill the array with data (from a remote service) that the tableview is updated, which is the case for my other approach where I bind to myModel.contactsArray directly.

The Problem: No data

However, the table remains empty. Do I have to setup something else for this to work (Maybe some willChangeValueForKey-magic or something else I have missed. I already tried to set the array controller as the dataSource and the delegate of the NSTableView but that did not seem to work either (Anyway it is not clear to me how dataSource and the Table Content binding “relate to each other”).

  • 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-29T09:34:06+00:00Added an answer on May 29, 2026 at 9:34 am

    When you fill up your array with content, are you re-assigning an immutable array or appending to a mutable array? Either way, it won’t work quite how you’re expecting.

    When you set the content of an array controller this way, instead of keeping a reference, the array controller just copies the content. Subsequent changes will have no effect, whether it’s a mutable array (nor if you reassign the model’s contactsArray).

    Instead:

    1. Call -add:on the array controller when you insert content. That probably that won’t help in your case.

    2. If you use immutable arrays you could bind the array controller to myModel‘s contactsArray key instead of assigning it.

    3. If you use a mutable array I don’t think that will work. You could create a second array controller in the model and bound the view’s array controller to contactsArrayController.arrangedObjects. Maybe there’s a better way, but that’s what I’ve done in the past.

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

Sidebar

Related Questions

Here is my current situation: I have a user class that has an attribute
Current situation: Have a timesheet that allows the user to enter their leave, TOIL,
in the current situation, when we post data from a webpage via the Jquery
Current situation: I have the current version of my MVC Framework which uses classes
In my current situation I have a class that performs an operation synchronously. During
I have a list of approx. 10000 items. The current situation is that every
Current situation: Ubuntu 8.04 server edition (live server) Postgresql 8.3.7 (from standard repositories) Postgis
My current situation is: I have to read a file and put the contents
The current situation is that topics are sorted by 3 main categories. There is
In my current situation, it is not unusual for me to have several UNIX

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.