• 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
Drag a row and create a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drag a row and create a file


  • Subject: Drag a row and create a file
  • From: Lorenzo Puleo <email@hidden>
  • Date: Thu, 19 May 2005 08:42:25 +0200

Hi,
I can quite drag a row from my outline view to the Finder and tell the
Finder to "copy" a file. It works well. But, how can I "save" my own data to
a file?

- (BOOL)outlineView:(NSOutlineView*)olv writeItems:(NSArray*)items
       toPasteboard:(NSPasteboard*)pboard
{
    NSArray *types = [NSArray arrayWithObject:NSFilenamesPboardType];
    [pboard declareTypes:types owner:self];

    // just to be short here I copy an existing file...
    NSArray *fileNameList = [NSArray arrayWithObject:@"/aFile.jpg"];
    [pboard setPropertyList:fileNameList forType:NSFilenamesPboardType];

    return YES;
}


- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal
{
    if (isLocal) return NSDragOperationNone;
    else return NSDragOperationCopy;
}

This works very well. But indeed I want to tell the Finder to save my own
data to that pathname. I have been trying with dragPromisedFilesOfTypes
unsuccessfully. Can someone explain what I have to do exactly?
Thank you.


Best Regards
--
Lorenzo
email: email@hidden

 _______________________________________________
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

  • Follow-Ups:
    • Re: Drag a row and create a file
      • From: Kristin Forster <email@hidden>
  • Prev by Date: Re: Using an alternate sort selector for a bound table column?
  • Next by Date: CoreData & Relationship binding not sending updates?
  • Previous by thread: Calendar dates and core data
  • Next by thread: Re: Drag a row and create a file
  • Index(es):
    • Date
    • Thread