• 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
Funky file URLs from drag & drop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Funky file URLs from drag & drop


  • Subject: Funky file URLs from drag & drop
  • From: Rick Mann <email@hidden>
  • Date: Fri, 11 May 2012 16:58:38 -0700

Why am I getting URLs from a file-drag operation that look like this?

	/Users/rmann/Library/Developer/Xcode/DerivedData/DataOverlay-bcjfnacanylbcychqjbfqjytdptq/Build/Products/Debug/file:/localhost/Users/rmann/Desktop/SpaceX_CCDEV2.jpg

They should just be:

	/Users/rmann/Desktop/SpaceX_CCDEV2.jpg

Here's my code:

- (BOOL)
performDragOperation: (id<NSDraggingInfo>) inSender
{
	NSMutableArray* files = [NSMutableArray arrayWithCapacity: inSender.numberOfValidItemsForDrop];

	[inSender enumerateDraggingItemsWithOptions: 0
				forView: self
				classes: [NSArray arrayWithObject: [NSPasteboardItem class]]
				searchOptions: nil
				usingBlock:
				^(NSDraggingItem* inDraggingItem,
					NSInteger inIdx,
					BOOL* outStop)
				{
					NSPasteboardItem* item = inDraggingItem.item;
					NSString* path = [item stringForType: @"public.file-url"];
					NSURL* url = [NSURL fileURLWithPath: path];
					[files addObject: url];
				}];

	if ([self.delegate respondsToSelector: @selector(timelineView:didReceiveFileURLs:)])
	{
		[self.delegate timelineView: self didReceiveFileURLs: [files copy]];
	}

	return true;
}

TIA,
Rick


_______________________________________________

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

  • Follow-Ups:
    • Re: Funky file URLs from drag & drop
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: First Responder
  • Next by Date: Re: Funky file URLs from drag & drop
  • Previous by thread: Re: NSViewAnimation reversed when using NSAnimationEaseOut
  • Next by thread: Re: Funky file URLs from drag & drop
  • Index(es):
    • Date
    • Thread