Re: NSOutlineView update strangeness
Re: NSOutlineView update strangeness
- Subject: Re: NSOutlineView update strangeness
- From: Benjámin Salánki <email@hidden>
- Date: Tue, 13 Dec 2005 17:49:27 +0100
Hello Corbin,
I am using the Apple supplied DataBurn code as a starting point.
I set up a new TreeNode object from the data passed to it from the
pasteboard. I have modified the TreeNode class so it can hold a
custom icon for items, not like the Apple supplied code. I add this
icon information at the same time I run a function to determine if
the data source has at the given node level any children that have
the same name as the one I am about to drop. If yes, then I change it
to something like "New File 1", if the original was "New File". I
then pass this modified TreeNode object to the addChild: method of
the data source, which displays the newly added custom icon just
fine, but the name will be displayed as in the drag source, even
though if I query the data source programmatically it returns the
modified name. (using the baseName function of said example code).
Ben
On Dec 13, 2005, at 5:25 PM, Corbin Dunn wrote:
Ben,
It is hard to say what is wrong, but the problem probably isn't in
NSOutlineView but rather your datasource.
After dragging an item from the Finder onto the NSOutlineView I
want to to check if an item with the same name already exists. If
it does, I add a number to the end of the name. It all works fine,
only the NSOutlineView always displays the name from the original
source.
One can drag text from the pboard, or a filename. It sounds like
you are dragging filenames and doing something with them in your
app, and displaying them. The problem is probably due to how you
display the filenames, and/or get the display name, and/or rename a
file (if that is what you are really doing --- again, it is hard to
say from your description).
-corbin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden