Re: Drag & Drop iTunes tracks and Playlists
Re: Drag & Drop iTunes tracks and Playlists
- Subject: Re: Drag & Drop iTunes tracks and Playlists
- From: Sean Murphy <email@hidden>
- Date: Thu, 25 May 2006 14:18:31 -0400
On May 25, 2006, at 9:37 AM, Aalok wrote:
I am developing an application where in I want to drag and drop track
from iTunes to my application icon on the dock. Also drag and drop
should be allowed for playlists in iTunes.
I have tried
- (BOOL)application:(NSApplication *)sender openFiles:(NSArray *)
fileName
But it doesn't recognize the file. It simply doesn't go inside this
method.
Aalok,
Dragging to an application's dock icon can only dispatch to the NSApp
delegate the standard Apple event openFiles, which means the dragging
source must have set the pasteboard type to reference actual files
and provide their associated path. iTunes, when dragging songs from
the library to another application, exports the dragged source into
the "TemporaryItems" folder and must register a pasteboard type of
something other than the equivalent of just dragging those songs from
the Finder.
So, unless you can think of another solution, (like subclassing
NSApplication, maybe?), you'll have to stick with using a NSView or
NSWindow object to accept the dragged files, since they provide the
registerForDraggedTypes: method, which you can tweak to receive the
correct type.
-Murph
_______________________________________________
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