Re: NSOutlineView drag and drop problem
Re: NSOutlineView drag and drop problem
- Subject: Re: NSOutlineView drag and drop problem
- From: Graham Cox <email@hidden>
- Date: Fri, 11 Jun 2010 15:24:56 +1000
Thanks, but this is not the case.
The validateDrop method returns a NSDragOperation value that I compute. That is not the same value that the [<draggingInfo> draggingSourceOperationMask] returns, though that is certainly one of the many inputs I use when working out the validation.
The two methods do much the same work so there's a good opportunity to factor the code as Jens suggests, but locally saving the return value from validation works OK and appears to be all I can do.
--Graham
On 11/06/2010, at 6:27 AM, Tony Romano wrote:
> It does. Making a call to draggingSourceOperationMask in your acceptDrop method will give you the operation that is active. No need to cache it.
>
> -Tony
>
>
> On Jun 10, 2010, at 11:12 AM, Jens Alfke wrote:
>
>>
>> On Jun 9, 2010, at 11:12 PM, Graham Cox wrote:
>>
>>> In –outlineView:acceptDrop:item:childIndex: I can work out much the same set of conditions as above and mostly do the right thing, but since a move or a copy is equally likely, I need a way to determine what the last drag operation returned during validation actually was. There doesn't seem to be a way to do this by requesting it from any of the parameters passed to that method.
>>
>> Well, since acceptDrop takes the same parameters as validateDrop, it seems you should be able to work out the same operation that validateDrop arrived at. I often end up writing a subroutine that takes the dragging info and items and works out the operation and other useful stuff, and then have both of those methods call it.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden