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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:24:32+00:00 2026-05-26T04:24:32+00:00

In my cocoa app there is a NSTableView(10.7 lion view based tableview) only contains

  • 0

In my cocoa app there is a NSTableView(10.7 lion view based tableview) only contains one column, the cell in it is a custom NSTableCellView, in it there are several views and one of them is a NSImageView.

My data model has an integer status variable, I use cocoa binding and a NSValueTransformer to give different NSImage to this NSImageView.

The problem is, the image is not updated automatically. After the status is changed, the image only reflects the change after reload the list.

Thanks for any help 🙂

  • 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-26T04:24:32+00:00Added an answer on May 26, 2026 at 4:24 am

    Finally I solved my own question.

    I added observer for model’s “status” integer property. When this status changed, the actual table cell’s icon (NSImageView) has changed according to the cocoa binding but not updated. Then in the observe callback method, just add

    - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
    {
    Model *m = (Model*)context;
    NSInteger idx = [self.modelArray indexOfObject:m];
    NSTableRowView *row = [self.tableView rowViewAtRow:idx makeIfNecessary:NO];
    ListCellItem *cell = [row viewAtColumn:0];
    cell.icon.needsDisplay = YES;
    [cell.icon.image recache];
    [cell.icon display];
    }
    

    Then the image get updated as soon as status get changed.

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

Sidebar

Related Questions

In a cocoa app of mine, there is a method that does some operations
I have a Cocoa app with a custom, multi-step account setup that I implemented
I need to parse EML files within a Cocoa app. Are there some Objective-C
I'm developing a Cocoa (Touch) app and there's certain data (like own device information
I'm writing a Cocoa app. There is a socket in the application, and whenever
I'm developing a Cocoa app using XCode 4. One of the windows has a
is there a possibility to set cocoa app, so it will translate NSString (placed
Is there a way to force quit all other applications from a cocoa app?
My Cocoa app needs some small dynamically generated windows. How can I programmatically create
I have a Cocoa app that uses a WebView to display an HTML interface.

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.