Basic question about NSOutlineView configured as source list

Hi!

Is it possible to create such NSOutlineViews - like the Xcode navigator on the left, with clickable list items (buttons?) - purely via ASOC? I found several posts about NSDictionaries and arrays. But none of them was helpful to me with NSOutlineView. Example:

Container A
Item 1
Item 2
Item 3

Container B
Item 1
Item 2

Thanks.

Yes. The data needs to be a list of records containing sub-records, and then you can use bindings. But setting up the records correctly is reasonably complex.

Are these records part of an NSDictionary construct? I tried to bind one but I had no success, not sure if the dict had the right structure. So I’m looking for some sample code.

An AS record becomes an NSDictionary when passed to a Cocoa method, so you can sort of use the terms interchangeably in that respect.

I’m pretty sure someone posted an example of code for an NSOutlineView in this forum a while back, so a search should help you.

Now I can successfully load a plist into such NSOutlineView. But I get only blank entries with no text. I can collapse and click them. Is there something that has di be set in IB to make them appear or needs the plist some additional entries or a different structure? My plist:

<plist version='1.0'>   
    <array>
        <dict>
            <key>children</key>
            <array>
                <dict>
                    <key>child</key>
                    <string>test1</string>
                </dict>
                <dict>
                    <key>child</key>
                    <string>test2</string>
                </dict>
                <dict>
                    <key>chidl</key>
                    <string>test3</string>
                </dict>
            </array>
         </dict>
    </array>
</plist>

P.S.: Checked the tutorial “ApplescriptObjectC Part 4” http://macscripter.net/viewtopic.php?id=30359 and it’s the same there. Seems to be related to some changes in Xcode since then?

it sounds like a bindings problem. And that example you refer to is for a table view, not an outline view – it makes a lot of difference.