Start a new topic
Answered

Not working

Hi all,

I am trying to delete an Entity using the removeId method as shown in the code below:

@IBAction fund deleteEvent(_ sender:Any){

let id = self.eventId

eventStore.removeById(id!){ event, error in 

   if let event = event {

       print("Deleted Event")

   }else{

       print("Could not delete Event")

   }

}

}


I set eventStore as follows in my viewController 

let eventStore = DataStore<Event>.collection(.sync) 


However I get the error :

(PersistableIdKey) is missing in the propertyMapping() method. Please call super.propertyMapping() inside your propertyMapping() method


Looking at the image below, you do see that I call super.properyMapping

(I have the latest version of Kinvey SDK installed)


image


Thanks for your time,


Best Answer

Hello,


  1. PersistableIdKey - Key to map the _id column in your Persistable implementation class. "super.propertyMapping(map)"maps the "_id", "_kmd" and "_acl" properties. This is weird that even after including it inside the class definition, you are getting an error. Can you please share KID of your app and the SDK version that you are using?
  2. Can you please try manually entering the 'eventStore.removeById' method as mentioned here and see if it works?
  3. What is eventId? From where you are getting this information?


I have tried both the methods for deleting an entity and I am not seeing any issues.


Thanks,

Pranav



1 Comment

Answer

Hello,


  1. PersistableIdKey - Key to map the _id column in your Persistable implementation class. "super.propertyMapping(map)"maps the "_id", "_kmd" and "_acl" properties. This is weird that even after including it inside the class definition, you are getting an error. Can you please share KID of your app and the SDK version that you are using?
  2. Can you please try manually entering the 'eventStore.removeById' method as mentioned here and see if it works?
  3. What is eventId? From where you are getting this information?


I have tried both the methods for deleting an entity and I am not seeing any issues.


Thanks,

Pranav



Login or Signup to post a comment