Drag & Drop: NSFilenamesPboardType
Drag & Drop: NSFilenamesPboardType
- Subject: Drag & Drop: NSFilenamesPboardType
- From: Alex Fuller <email@hidden>
- Date: Wed, 08 May 2002 00:34:28 +0100
I think I must be short-circuiting somewhere:
The docs say NSFilenamesPboardType is an "NSString designating one or more
file names". I interpret that to mean that when I set up a drag for an icon
in my app representing a file, I do something like the following:
NSPasteboard *pb = [NSPasteboard pasteboardWithName:NSDragPboard];
NSString *filename = @"/tmp/test.txt";
[pb declareTypes: [NSArray arrayWithObject:NSFilenamesPboardType]
owner:self];
[pb setString:filename forType:NSFilenamesPboardType];
[self dragImage:iconImage at:dragPoint offset:NSMakeSize(0,0) event:event
pasteboard:pb source:self slideBack:YES];
...but when I do that I get a stream of errors on attempting to drag:
*** -[NSCFString count]: selector not recognized
Is it looking for an array? But how do I set that - there is no array
equivalent for NSPasteboard's setString:forType:? And the docs suggest an
NSString is required anyway...
Alex
PS only Cocoa apps seem to respond to the icon I'm dragging around - Finder
and BBEdit for example take absolutely no notice, while OmniWeb and
ProjectBuilder at least show willing to accept a drop even if I can't set my
data properly. Will solving my first problem sort this or is something else
wrong?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.