Closed daoan1412 closed 5 years ago
@daoan1412, thank you for contacting us! This works for me.
How are you creating your store, and have you checked that the object wasn't already in the store from a previous run? What happens when you use "\(Date())"
for the name? Do the duplicates have the same date and time?
I had to modify your code slightly to make it compile. id
and age
arelet
constants, so the compiler will complain about the assignments to them, and you're ignoring the return value from subscribe()
.
Once I changed id
and name
to var
and added a _ =
before the subscribe (in a real program, you'd of course keep the subscription around in a property or so), the code worked, and the records array contains only the single object I wrote.
Sorry, this is my mistake.