Re: Can I put UTIs in NSFilesPromisePboardType promise drag array?
Re: Can I put UTIs in NSFilesPromisePboardType promise drag array?
- Subject: Re: Can I put UTIs in NSFilesPromisePboardType promise drag array?
- From: Jim Correia <email@hidden>
- Date: Sat, 4 Oct 2008 23:31:06 -0400
On Oct 4, 2008, at 10:45 PM, Nathan Vander Wilt wrote:
HFS types seem to be well deprecated in nearly every other area, the
drag destination guides don't encourage checking the types anyway
Can you post a reference?
You generally should check the type in the drag, and not offer to
accept a drag which you can't accept.
and the API itself doesn't facilitate easy checking especially given
the fact that strings already are *either* extensions or legacy type
codes with no programmatic distinction.
Due to the convention for how HFS types are encoding, it is possible
to programatically distinguish the two, if you need to do so.
Plus who really wants to keep comparing strings (eg 'txt' vs. 'TXT'
vs. 'TEXT' times every other supported format) when they could be
using UTTypeConformsTo instead? :-)
Nobody really wants to keep supporting legacy standards when there are
new better ones. However, if you want to interoperate with stuff which
uses those legacy standards, you have to.
Until such time as NSPasteboard does implicit translation of UTIs put
in NSFilesPromisePboardType, any client only expecting to see
traditional types might fail. Only you can decide if you need to
interoperate with such clients.
As it turns outs, I've hedged my bets. I conservatively only put
traditional types when writing NSFilesPromisePboardType, but correctly
handle UTIs when receiving the drag. I don't know how many other
clients are as flexible.
- Jim
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden