I have a swift project with 3 entities in my xcdatamodeld: Access, CustomerInfo and User. I am trying to save the dateEndSubscription separately in the User. When I am trying to
The json message contains the key dateEndSubscription
but the attribute in your User entity is named dateEnd
so they doesn’t match.
A few options to solve this in your saveUser
method
Change API.DateEnd
to dateEnd
but maybe that will infer with the decoding of the json message.
Don't use API key but instead hardcode attribute name
user.setValue(dateEnd, forKey: "dateEnd")
and lastly use the property of the User class directly
user.dateEnd = dateEnd
You need to change saveCustomerInformation
as well since you are working with a User
object there as well although it's unclear why.