• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Accepting files dragged from iTunes in a Cocoa app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accepting files dragged from iTunes in a Cocoa app


  • Subject: Re: Accepting files dragged from iTunes in a Cocoa app
  • From: email@hidden (Stefan Haller)
  • Date: Thu, 11 Sep 2008 13:52:53 +0200

Excellent!  Thanks a lot, this works well for me too.

I didn't know about the "CorePasteboardFlavorType" mechanism, and I
couldn't find any documentation about it, so I suppose this isn't
guaranteed to work in the future.

Best,
   Stefan


Stephen F. Booth <email@hidden> wrote:

> Stefan,
>
> I use the following code to get the URLs from dragged files from iTunes:
>
> NSString * const iTunesPboardType = @"CorePasteboardFlavorType 0x6974756E";
>
> // Handle iTunes drops
> else if([bestType isEqualToString:iTunesPboardType]) {
>   NSDictionary *iTunesDictionary = [[info draggingPasteboard]
> propertyListForType:iTunesPboardType];
>   NSArray *tracks = [iTunesDictionary valueForKey:@"Tracks"];
>   NSEnumerator *enumerator = [tracks objectEnumerator];
>   NSDictionary *track = nil;
>   NSURL *url = nil;
>
>   while((track = [enumerator nextObject])) {
>     url = [NSURL URLWithString:[track valueForKey:@"Location"]];
>
>     if([url isFileURL])
>       ; // Do something with URL
>   }
> }
>
> Stephen


--
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/
_______________________________________________

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

References: 
 >Re: Accepting files dragged from iTunes in a Cocoa app (From: "Stephen F. Booth" <email@hidden>)

  • Prev by Date: Re: BOOL array
  • Next by Date: Re: Rounding very small numbers.
  • Previous by thread: Re: Accepting files dragged from iTunes in a Cocoa app
  • Next by thread: [MEET] CocoaHeads-NYC Thursday 9/11
  • Index(es):
    • Date
    • Thread