iOS Question Problem SetField Invitees

mayahandayani

Member
Licensed User
Hello!
I have problem when I want to set some emails as invitees using EventKit (https://developer.apple.com/documentation/eventkit/ekparticipant?language=objc).
This is my code :
B4X:
Dim ev As CalendarEvent = store.CreateEvent
Dim newEvent As NativeObject = ev

Dim attendee As NativeObject
attendee.Initialize("EKParticipant")
Dim url As NativeObject
url.Initialize("NSURL")
url = url.RunMethod("URLWithString:", Array("mailto:" & "....@yahoo.com"))
Dim attend As List
attend.Initialize
attend.Add(url)
attendee.SetField("URL", attend)       
newEvent.SetField("attendees", Array(attendee))

and I've got error like this
B4X:
[<EKParticipant 0x1f64fca80> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key URL.

what's wrong?
thanks
 
Last edited:

mayahandayani

Member
Licensed User
Please post the link to the property documentation that you want to set. If it is a field that you see with the debugger and it isn't documented then you will not be able to call it.

I'm using EKParticipant but I have no idea how to set the email as invitees. Or what the property I can use and how to set it?

Thanks
 
Upvote 0

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
Looks like you are using the wrong object.

from the documentation

 
Upvote 0

mayahandayani

Member
Licensed User
like this?
B4X:
Dim attendees As List
attendees.Initialize
Dim attendee As NativeObject
attendee.Initialize("EKAttendee")
attendee.SetField("emailAddress", ".....@yahoo.com")
attendees.Add(attendee)
newEvent.SetField("attendees", attendees)
but still same error
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…