Re: Accepting iCal events dropped on my application's icon
Re: Accepting iCal events dropped on my application's icon
- Subject: Re: Accepting iCal events dropped on my application's icon
- From: Yang Meyer <email@hidden>
- Date: Mon, 22 Dec 2008 12:34:14 +0100
Sean,
So in essence my question is: How can I tell my application to
accept iCal events dragged directly from the iCal GUI?
When iCal events are dragged and exported to another application,
iCal will provide a promised .ics file in ~/Library/Caches/
TemporaryItems. This file has an extension "ics" and a UTI of
com.apple.ical.ics. Ideally, you'd just set the Document Types in
your target's properties (Info.plist) to support this file, but it
seems a bit tricky since this is a promised file and probably does
not have these attributes set yet during the drag.
I didn't have a lot of time to experiment or research how to support
promised file drops on the application icon, but one way to make
this work is to register a "catch all" document type in Info.plist,
and then your application will allow drops of iCal events, although
along with it every other kind of file. You can do this in your
target's properties window by adding a document type with an
extension of "*" and an OS type of "****".
Thanks for the tip. Since indeed it seems that the attributes (UTI
etc) are not set yet when the promised file is dragged, I implemented
it with the catch-all solution you sketched.
The usability downside of catch-all is that the app icon gets darker
(signalling that it accepts a dragged item) with whatever you drag
onto it, e.g. folders, pictures, … So if anyone knows a better
solution, I'm still interested :-)
Thanks again,
Yang_______________________________________________
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