At 3:22 PM -0500 2/13/03, Sherm Pendley wrote:
NSOutlineView appears to depend on the data objects passed to it
being retained. Normally, any object that has this requirement simply
issues the retains itself, and corresponding releases when its
finished with the objects it needed. But, NSOutlineView doesn't do
that; you have to explicitly retain the objects you pass to it. This
presents a problem, because you can't retain NSString objects in CB
right now, as they're automagically converted to and from Perl
scalars. This magic conversion will be enhanced in CB 0.3, to allow
for access to the native NSString objects, but for now the workaround
is to use NSAttributedString objects instead.
For the most part, I used Cocoa's NSDictionary, NSArray, and
NSFileManager objects in this sample, instead of Perl hashes, arrays,
and opendir/readdir functions. I figured the Perl stuff already has
more documentation than you can shake a camel at, so doing it the
"Cocoa Way" would be more useful as an example.
I'm unclear on which things you did using Cocoa data types because
you had to and which you did for expository reasons. Specifically,
is it necessary to use a Cocoa object as the "item" or can one use
a Perl string? If it's the latter, do I have to be careful to use
a particular copy of the string or can I just make sure that the
value is correct?
-r
--
email: [EMAIL PROTECTED]; phone: +1 650-873-7841
http://www.cfcl.com/rdm - my home page, resume, etc.
http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc.
http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series
http://www.ptf.com/tdc - Prime Time Freeware's Darwin Collection