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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:10:53+00:00 2026-05-25T14:10:53+00:00

I have a NSTreeController with bindings to a class. NSOutlineView dirTree binds to the

  • 0

I have a NSTreeController with bindings to a class.

NSOutlineView dirTree binds to the NSTreeController

In particular Outline View Content binds to arrangedObjects

This appears to work well, but I am at my wits end to figure out why it does not respond to reloadData.

The NSTreeController
Key paths are:-

Children    subDirectories
Count       numberOfSubDirs

These are listed below; numberOfSubDirs returns a simple count of subDirectories (with an added diagnostic display).

- (NSArray *)subDirectories {
    if (subDirectories == nil) {
        [self loadSubDirectories];
    }
    return subDirectories;
}

- (NSInteger)numberOfSubDirs {
    NSArray *tmp = [self subDirectories];
    NSLog(@"numberOfSubDirs %@ %d", [self relativePath], [tmp count]);
    return [tmp count];
}

If I call a refresh function which updates the data then calls [dirTree reloadData]; I get the following output:-

Reload Data
numberOfSubDirs Shared 7
numberOfSubDirs Adobe 1
numberOfSubDirs bZTree2 0
numberOfSubDirs Ian Documents 25
numberOfSubDirs Library 1
numberOfSubDirs NET 1
numberOfSubDirs TSA 12
numberOfSubDirs Wacom 1

If I delete a directory (externally in Finder) and call the refresh function I get the following output:-

Reload Data
numberOfSubDirs Shared 6
numberOfSubDirs Adobe 1
numberOfSubDirs bZTree2 0
numberOfSubDirs Ian Documents 25
numberOfSubDirs Library 1
numberOfSubDirs NET 1
numberOfSubDirs TSA 12
numberOfSubDirs Wacom 1

NSTreeController calls numberOfSubDirs on the parent “Shared”, and is correctly told it now has 6 subdirectories.

However it then queries 7 subdirectories, including the deleted item “bZTree2”, and does not refresh the display to show only the 6 which exist.

  • 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-25T14:10:53+00:00Added an answer on May 25, 2026 at 2:10 pm

    NSTreeController does not respond to -reloadData because it doesn’t implement that method. You will get both a runtime exception and a compiler warning if you try to call it on an NSTreeController instance.

    NSOutlineView responds to -reloadData, but it won’t do anything unless the NSOutlineView uses a data source. If you are using NSTreeController it won’t do anything at all.

    Since you seem to be creating a file system view, I highly recommend you go via the data source route rather than using NSTreeController, it will save you a lot of trouble.

    Apple has some documentation and sample code for doing this also.

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

Sidebar

Related Questions

I have a View-based NSOutlineView bound to a NSTreeController. Everything seems to work correctly
Have converted devise new session from erb to Haml but doens't work, this is
i have this simplified Model: https://i.stack.imgur.com/d2WsV.png I have these Elements ordered in an NSOutlineView
In my app, I have an NSOutlineView that gets its data from a NSTreeController
I have an outline view and a button. I want the button to remove
I have now nearly figured out how to Filter a NSTreeController, to do this
I have a Cocoa app with an NSOutlineView managed by an NSTreeController . In
I have an outline view with 2 entities being displayed inside it so It
When I select a row in my outline view (connected to a NSTreeController) and
I have a (new in Lion) view-based NSOutlineView as Sidebar SourceList in my app

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.