I also don't think this is in the API. 

The relevant information is stored in the Info.plist file for each calendar. 
The keys are 'EventContainer' and 'TaskContainer', both boolean.

Best wishes

John Maisey
----
www.nhoj.co.uk
www.twitter.com/johnmaisey
www.facebook.com/nhojcouk





On 23 Feb 2012, at 23:04, cocoa-dev-requ...@lists.apple.com wrote:

> Message: 10
> Date: Fri, 24 Feb 2012 08:49:33 +1000
> From: Gideon King <gid...@novamind.com>
> To: Jeremy Matthews <jeremymatth...@mac.com>
> Cc: list-cocoa-dev Development <cocoa-dev@lists.apple.com>
> Subject: Re: iCal Integration
> Message-ID: <4ad9e40b-977e-4901-a1cb-a068efd8f...@novamind.com>
> Content-Type: text/plain; charset=windows-1252
> 
> I don't see anything in the API to detect it - I have encountered calendars 
> that don't support tasks, and if I try to save a task to them, I get an error 
> with code 1025 (CalCalendarNotEditableError), and deal with that in my code. 
> 
> isEditable returns YES for a calendar which only supports events, so you 
> still have to try to save a task to it before you know it won't store tasks.
> 
> I haven't come across one that can't save events yet. Do you know what error 
> code you get back when you try to save an event to a calendar which doesn't 
> support events? I'm assuming it's the same code?
> 
> I haven't looked at the "type" property to see if the values there bear any 
> relationship to what can be saved to it, but that seems like the only other 
> property that could potentially be relevant…
> 
> 
> HTH
> 
> Gideon
> 
> 
> On 23/02/2012, at 1:19 PM, Jeremy Matthews wrote:
> 
>> I have a simple app which, as a byproduct, creates tasks and events in iCal. 
>> Prior to 10.7, the user would choose from a popup list populated by all 
>> calendars within the [CalCalendarStore defaultstore], which worked great and 
>> created both events and tasks perfectly fine.
>> 
>> Now, in 10.7, it seems as if a CalDAV (alal iCloud) or Exchange calendar is 
>> separated into two separate objects - one for events and one for tasks, and 
>> the result is the user is shown a list of calendars...and in many cases 
>> users appear to see duplicates, when in reality there are those two separate 
>> "calendars".
>> 
>> So now, when a user selects the calendar, they might get an event created, 
>> but not tasks, and vice-versa. 
>> 
>> Is there any known way of dealing with this, or any way to easily find out 
>> which "calendar" supports events vs tasks, instead of firing off a "test" 
>> tasks and finding out the hard way? Or perhaps, a better solution altogether?
>> 
>> Thanks,
>> jeremy
> 


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to