Re: mysterious NSOutlineView crashing
Re: mysterious NSOutlineView crashing
- Subject: Re: mysterious NSOutlineView crashing
- From: Generic User <email@hidden>
- Date: Mon, 17 Feb 2003 11:24:04 -0600
Alex,
You may have it solved already. If not, two things to keep in mind
which you probably already know.
1.) The dragged entity is a COPY of the original
2.) If you ADD the COPY **first**, then the original will be at a new
index if the drag was to a LOWER index
In other words, if you drag item 5 to be at a new index of 3, and you
add the copy of item 5 at index 3, then the original item 5 is really
item 6
and so forth for the other way around as well.
Also, it may not matter to you but if any other part of your code
refers to the original object, then you will have two objects that you
are treating as the same when in fact they will be different instances.
To avoid ALL confusion in the future (with your app), I would use the
unarchived (dragged) item...ONLY to allow you to LOCATE the original in
the datasource. Then, I'd simply move the original as appropriate and
let the dragged copy free itself after the
-outlineView:acceptDrop:item:childIndex: method returns.
This way, the visual interface and the datasource are TRULY kept the
same.
I do this because many of my objects refer to one another. REF the
Circular referencing post we've chatted about!!
d
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.