Drag a row and create a file
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