Re: Cocoa-dev Digest, Vol 3, Issue 1261

  • On Oct 17, 2006, at 17:03 AM, Scott Stevenson wrote:

    > On Oct 17, 2006, at 4:07 PM, The Beerbowers wrote:
    >
    >> I'm writing a program which contains an outline view. The data
    >> source manages a bunch of dictionaries, arrays, and other objects
    >> nested inside each other. My problem is that when the data source
    >> method outlineView:objectValueForTableColumn:byItem: is called, I
    >> need to be able to get a pointer to the item's parent so I can find
    >> its key in the case that it is in a dictionary, or its index if its
    >> in an array. Is there any simple way of doing this, or am I going
    >> to have to make a big work around? Any help would be appreciated.
    >> Thanks.
    >
    > Create a simple NSObject subclass and use that instead of arrays,
    > dictionaries, etc. The subclass can have a weak reference to its
    > parent.
    >
    > - Scott

    I'm not sure if I understand what your saying here. Maybe I didn't
    explain my problem very well either? Just in case here's an example:

    The data source's method outlineView:outlineView
    objectValueForTableColumn:tableColumn byItem:item is called. From
    this method I need to get a pointer to 'item's parent in the
    NSOutlineView. That is my entire problem. (Sorry for being so cryptic
    before.)
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today