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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:03:31+00:00 2026-06-01T06:03:31+00:00

I am new to Cocoa programming (but relatively experienced with other UI frameworks) and

  • 0

I am new to Cocoa programming (but relatively experienced with other UI frameworks) and can’t tell exactly where I am going wrong in
the following situation.

I have a ‘tree’ of data that is wrapped by a NSOutlineViewDataSource. The items are very basic read/write (think checkboxes). However, when

setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item

is called, the changes I make do not just affect the single item in question, but can propagate to other items i.e. checking one item might cause other items in the tree to select or deselect. At the data model level, I have got this working fine. My problem is somehow forcing the outline to refresh so that these other changes appear in the UI.

So basically, when setObjectValue is called the individual cell that is changed is refreshed, but I need (potentially) the whole tree to refresh in the UI.

What is the best practice mechanism for doing something like this? Is there an event on the NSOutlineView I should be listening for to then trigger a refresh. Should my NSOutlineViewDataSource be raising an event that the view listens for? Or is my basic approach entirely wrong?

(I am actually doing this with Monomac but I think any answer applies to cocoa in general)

  • 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-01T06:03:32+00:00Added an answer on June 1, 2026 at 6:03 am

    Andrew – the easiest way to do this is to look into KVO programming. If a particular item you want to watch is KVO compliant, you can set up a watcher on it with “addObserver” Then you implement the delegate function “observeValueForKeyPath” in the observer class and can force the changes to the UI when that function is notified of a change to the value you’re watching. Not everything is KVO compliant, so your mileage my vary depending upon the nature of the thing you’re wanting to monitor for changes. But if you’re watching a property on a custom object, it will definitely be fine to use KVO.

    The KVO programming guide is here:

    https://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/KeyValueObserving/KeyValueObserving.html

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

Sidebar

Related Questions

I'm very new to Cocoa for MacOSX, but I can't help but feel like
I'm new to Cocoa and xCode, but not programming though. I have created some
I'm new to OS X programming but generally liking it. I have the following
I'm rather new to programming in Cocoa, but I've been working on learning the
I am relatively new to Cocoa programming, and some aspects of memory managing are
Relatively new to Cocoa here. This question is about NSFileHandle, but I got a
I'm new to cocoa programming but i'm wondering if there is a way to
I'm new to cocoa programming but I picked up a project and keep running
I'm new to Cocoa/macOS programming. I just found out that NSUserDefaults can be used
I'm fairly new to Objective-C and cocoa programming, so I don't really understand the

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.