You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current way of updating COPrimitiveCollection content has some logic holes, so this needs to be rewritten. I'll take a look at this soon.
For example, we probably want to pass an argument 'isDeserialization' to -setValue:forVariableStorageKey: so we can choose correctly between making a copy or updating the current collection content.
At deserialization time in -setValue:forVariableStorageKey:, we want to:
avoid copying a COPrimitiveCollection argument (just created by the deserialization code)
keep tombstones from the COPrimitiveCollection argument
If we have an existing collection, tombstones and live content must be replaced/overwritten by the ones from the collection passed in argument.
For a property update in -setValue:forVariableStorageKey:, when we replace a collection with another one, we want to:
copy the collection in argument or insert its content into our existing collection (to avoid any accidental sharing)
ignore tombstones (e.g. when we receive a COPrimitiveCollection in argument by doing an update like innerObject1.contents = innerObject2.contents)
This last point means that for COPrimitiveCollection, we cannot copy it but we must use -[COMutableSet setSet], -[COMutableArray setArray:]. Both methods will correctly ignore the tombstones. For any other collections, we could make a copy, but using -[NSMutableSet setSet] and -[NSMutableArray setArray:] works just fine and happens to make the code simpler.
The text was updated successfully, but these errors were encountered:
Quentin says: (from 793a447#commitcomment-15704526 )
The text was updated successfully, but these errors were encountered: