DragToFinder Example Dest not working

Hi,

I’m testing the DragToFinder Xojo example and try to figure out how DragItem.Destination works (On Mac).

When testing it DragItem.Destination never seems to be set to a a folderitem… Am I missing something?

From the example project:

[code] Dim di As DragItem
Dim f As FolderItem
Dim d As Date
Dim tos As TextoutputStream

d = New Date
f = SpecialFolder.Temporary.Child(“test” + Format(d.TotalSeconds, “#”))
If f <> Nil Then
tos = TextOutputStream.Create(f)
tos.Write(“Howdy! Created by DragToFinder example.”)
tos.Close

di = New DragItem(Self, 0, 0, 100, 100)
di.FolderItem = f 
di.Drag
If di.Destination <> Nil Then
  If di.Destination IsA FolderItem Then
    MsgBox(FolderItem(di.Destination).AbsolutePath)
  End If
End If

Else
MsgBox(“Unable to get FolderItem for temporary file.”)
End If[/code]

please don’t post code out of context. what method or event is this in?

Looks like this Cocoa bug: feedback://showreport?report_id=21991

Dave: Sorry but it is just code from an Xojo example.

Paul: Thanks, there seems to work arounds:

In the Feedback case this is noted: (Posting here for convenience.)

Thomas Tempelmann on 30 maj 2013 at 14:54
MacOSLib (since today) has a new CarbonDragManager class and comes with an Example that demonstrates how to solve this for now.

Christian Schmitz on 27 sep 2013 at 22:55
I wonder how to get the destination in Cocoa in objective-C. We have a lot of drag and drop things for Cocoa in the MBS Plugins, so it could be easy to add to the plugin as a workaround.