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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:48:58+00:00 2026-05-16T02:48:58+00:00

I’m wondering how one would implement an outline view like the one Xcode 3

  • 0

I’m wondering how one would implement an outline view like the one Xcode 3 is using for the build configuration:

alt text

When using an NSOutlineView/NSTableView with bindings and an NSTreeController/NSArrayController, the view’s columns get bindings assigned to, not the individual cells, for obvious reasons.
If every row in a column uses the same cell, then it’s a piece of cake. However if every row (potentially) uses its own cell type (and with that potentially its very own collection of bindings), then things get funky.

Looking at the screenshot one can clearly see that the textfield cell needs just a single binding for “value”. While the popup button cell needs at least one for “content“, one for “contentValues” and last but not least one binding for “selectedIndex / selectedObject / selectedValue“. And the checkbox cell needs a binding for “value” and (probably) one for “title“.

How would one accomplish this with as clean (and little) code as possible?
(Or as one might ask: How would Apple have done it?)

…

Here’s what I’ve tried myself so far:
I provide the appropriate (copied) cells via [outlineView:dataCellForTableColumn:item:] and bind them to the individual data models (from [item representedObject]).
I know the exact amount of data (< 500 rows) being displayed in the outline view, so having one cell per row shouldn’t be too much of a memory issue, no?
I got the data to get displayed properly via bindings (yay!) however I’m unable to change any of their values. O_o
Apparently the value change simply never gets thru to the data model. Is there more to it than a simple [checkboxCell bind:@”value” toObject:rowModel withKeyPath:@”value” options:nil]? (as this seems sufficient for getting values, but not for setting them accordingly.)

I couldn’t find any information on this topic. Lots of info and hints for using custom cells per column, but none for using them on a “per row” basis. 🙁
This would make some great stuff for a Cocoa tutorial, wouldn’t it? 😉

  • 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-16T02:48:59+00:00Added an answer on May 16, 2026 at 2:48 am

    The data cell of a column isn’t copied. The cell is configured for the proper value for the column in each row and drawn in its proper place. A good place to hook in is at the NSTableColumn method -dataCellForRow:. In a custom subclass, you could override this method and pass either its -dataCell for normal operation or some alternate cell type.

    I had an occasion to have a checkbox column representing “include” in an outline view that only appeared for children (non-root items). The root items couldn’t be excluded, only their children, so it made sense only to show the checkbox for non-root items.

    I created a custom NSTableColumn subclass that took a delegate (my data source controller) and checked to see if it responded to the selector -deadCellColumn:shouldShowDeadCellForRow:. If it did, I called that method (which was implemented on my data source controller) to ask it if I should show a “dead cell” (a basic NSCell subclass that draws nothing) and swapped it according to the answer. If the delegate didn’t respond to the selector, the table column returns its normal -dataCell.

    The custom cell (which I called “DeadCell”) was needed here because I wanted to ensure nothing got drawn and nothing was editable. I’m not sure it was strictly necessary but I did it anyway. This isn’t much use in your case, but I wanted to state it anyway for completeness.

    Your situation is a bit more complicated, especially because Bindings are involved (and different data cell types can have different bindings for their value — popups can be especially challenging). In my case, I eschewed bindings for the tried-and-true data source mechanism. It simplified things greatly. 🙂 For your case, it’s easy enough to swap cell types around using data source methods.

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

Sidebar

Ask A Question

Stats

  • Questions 545k
  • Answers 545k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • added an answer Well, start off by thinking of which bits of data… May 17, 2026 at 9:17 am
  • added an answer For this task it is a good idea to use… May 17, 2026 at 9:15 am
  • added an answer This is exactly how the Skyhook database (built into many… May 17, 2026 at 9:15 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.