Re: NSOutlineView
Re: NSOutlineView
- Subject: Re: NSOutlineView
- From: Mike Jackson <email@hidden>
- Date: Thu, 26 Jul 2001 12:20:44 -0400
on 7/25/01 4:18 PM, email@hidden wrote:
>
Mike,
>
>
I don't know if this is what Sandeep intended to say, but here's how I got
>
around the "contention" problem:
>
>
I was seeing all kinds of errors when I returned Java objects (Strings) from
>
my DataSource's outlineViewChildOfItem() method; I now return NSObjects from
>
outlineViewChildOfItem(), and maintain mappings so that I can identify the
>
appropriate Java object on subsequent calls (such as
>
outlineViewObjectValueForItem()).
>
>
I have not found it necessary to make my DataSource a subclass of NSObject,
>
although I can't say the idea is without merit.
>
>
I can share more code snippets later (from another machine) if that'll help.
>
>
Doug K;
>
>
----- Original Message -----
>
From: "Mike Jackson" <email@hidden>
>
To: "Sandeep Parikh" <email@hidden>; <email@hidden>
>
Sent: Wednesday, July 25, 2001 1:22 PM
>
Subject: Re: NSOutlineView
>
>
>
> on 7/25/01 1:44 AM, email@hidden wrote:
>
>
>
>> Mike,
>
>>
>
>> NSOutlineView will not retain your objects, that is the responsibility
>
>> of the class you designated as your data source for the outline. You
>
>> must retain them in your data source by keeping them in a Cocoa object
>
>> (like an NSArray, NSDictionary, etc.), not in a pure Java object.
>
>>
>
>> -Sandeep
>
>>
Inside of my DataSource Object, there is the static variable root. This is
the root ISTLFile Object. Since I keep a reference to this at all times by
virtue of it being a Class variable and instantiated in the constructor and
root has a reference, via a Vector of all its children, and all those
children should have a reference to all of their children, and so on,
shouldn't all those objects be kept around and not get gc'ed?
I have tried to have ISTLFile extend NSObject and implement
NSOutlineView.DataSource, but this is not working out correctly.
I try to cast the ISTLFile into an NSObject, but the compiler throw an
"inconvertable type" error.
So evidently I am still new to Java, so I am just missing something, but any
help/Discussion on the topic would be helpful
--
Mike Jackson
www.infoscribe.com