i am trying to create a new Reminder Calendar (CalDav) on OS X in a 64Bit App, using the EventKit Plugin from the MBS Complete Package.
Gaining access to the EventStore works fine and i can read and write Events/Reminders just fine, but when i try to create a new Reminder Calendar, nothing happens. No error message no hints in the OS X console.
I am using the following Code to create a new Calendar:
[code] Dim r As New EKCalendarMBS(1, App.EventStore)
dim e as NSErrorMBS
r.title = “Test”
dim rc() as EKCalendarMBS = App.EventStore.calendarsForEntityType(1)
rc.Append®
App.EventStore.Commit(e)
If e<>Nil Then MsgBox e.LocalizedDescription
Exception n as NSExceptionMBS
MsgBox n.message[/code]
Can you please help me to solve this issue?
Thank you for your kind help.
[code]Function CreateNewCalendar(CalendarName As String, CalendarEntityType As Integer, Optional CalendarAccount As String = “iCloud”) As String
Dim theCalendar As New EKCalendarMBS(CalendarEntityType, EventStore)
dim kitError as NSErrorMBS
Dim theSources() As EKSourceMBS
dim ReminderCalendars() as EKCalendarMBS = EventStore.calendarsForEntityType(CalendarEntityType)
theCalendar.title = CalendarName
theSources = EventStore.sources()
For Each tempSource As EKSourceMBS In theSources
If tempSource.title = CalendarAccount Then
theCalendar.source = tempSource
ReminderCalendars.Append(theCalendar)
If EventStore.saveCalendar(theCalendar, True, kitError) Then
Return "OK"
Else
Return kitError.LocalizedDescription
End If
Exit For tempSource
End If
Next
Exception n as NSExceptionMBS
Return n.message
End Function
[/code]