• 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
Re: Drag & Drop: NSFilenamesPboardType
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Drag & Drop: NSFilenamesPboardType (From: Alex Fuller <email@hidden>)

  • Prev by Date: Re: List of delegates
  • Next by Date: Re: Thread and Return key strangeness
  • Previous by thread: Drag & Drop: NSFilenamesPboardType
  • Next by thread: SIGPIPE?
  • Index(es):
    • Date
    • Thread