Re: Drag & Drop: NSFilenamesPboardType
Re: Drag & Drop: NSFilenamesPboardType
- Subject: Re: Drag & Drop: NSFilenamesPboardType
- From: email@hidden
- Date: Tue, 7 May 2002 17:30:24 -0700
[pb setPropertyList:[NSArray arrayWithObject:filename]
forType:NSFilenamesPboardType];
On Tuesday, May 7, 2002, at 04:34 PM, Alex Fuller wrote:
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
_______________________________________________
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.