• 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
Promising files and folders - what type(s)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Promising files and folders - what type(s)?


  • Subject: Promising files and folders - what type(s)?
  • From: James Bucanek <email@hidden>
  • Date: Sun, 12 Jun 2005 17:34:47 -0700

I'm implementing drag-n-drop in my NSOutlineViiew.  My outline view can be a source of files and folders.  I'm getting stuck on what file types to provide when the NSOutlineView calls outlineView:writeItems:toPasteboard.

The documentation for promising files says to declare NSFilesPromisePboardType as the data type, and a property list of the HFS types for each item being promised.  They give the example of promising a 'pdf' file.  The DragNDropOutlineView example code just promises 'txt' files.

So how do you promise a folder?  Or a package?  If a file has both an OSType in the FinderInfo structure and an extension, which do you pass?

Right now, the folder question has me stumped.  I can find no documented "type" to use as a folder.  Calling NSHFSTypeForFile() on a folder, or even a package, returns nil(!!!).

If I don't promise anything (you can't put a nil in an array), the drag gets refused.  So I have to supply *something*.

Right now, I'm getting my code to work by returning @"fold" for folders.  I'm ignoring the case of packages and just promising a folder.  For files I return the OSType if FinderInfo has an fdType field, the extension of the file if not, or @"doc" otherwise.  But this all seems very dodgy to me...

--
James Bucanek <mailto: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

  • Prev by Date: [Slightly OT] Game Programmer Salary?
  • Next by Date: Re: how to make an NSWindow unmovable...
  • Previous by thread: [Slightly OT] Game Programmer Salary?
  • Next by thread: Re: Adding NSImage to empty QTMovie
  • Index(es):
    • Date
    • Thread