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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to