Code Comments vs. Docs for Core Data merge policies are wrong
| Originator: | patrick | ||
| Number: | rdar://34812662 | Date Originated: | 10.4.2017 |
| Status: | OPEN | Resolved: | |
| Product: | iOS SDK/Core Data | Product Version: | iOS 11 |
| Classification: | Bug | Reproducible: | Yes |
Area: Core Data Summary: If I command click on an NSMergePolicy and xcode shows me the documentation for the different policies, the comments in code differ from those in the Core Data docs available online. Steps to Reproduce: Command + click on an NSMergePolciy in code, and read the comments for that policy. Compare to comments in the docs. These are incorrect for at least the two trump merge policies. Please see external docs here: https://developer.apple.com/documentation/coredata/nsmergebypropertystoretrumpmergepolicy * Note: the documentation for NSMergeByPropertyStoreTrumpMergePolicy describes it as such: "A policy that merges conflicts between the persistent store's version of the object and the current in-memory version by individual property, with the in-memory changes trumping external changes." while the code docs describe it as such: "This singleton policy merges conflicts between the persistent store's version of the object and the current in memory version. The merge occurs by individual property. For properties which have been changed in both the external source and in memory, the external changes trump the in memory ones." Notice how the last sentence is exactly the opposite. The same can be said of NSMergeByPropertyObjectTrumpMergePolicy, where the docs show: "A policy that merges conflicts between the persistent store's version of the object and the current in-memory version by individual property, with the external changes trumping in-memory changes." which is opposite of code comments that show this "This singleton policy merges conflicts between the persistent store's version of the object and the current in memory version. The merge occurs by individual property. For properties which have been changed in both the external source and in memory, the in memory changes trump the external ones." Expected Results: The code comments and docs match. Actual Results: I would like to know which of the two is accurate. Based on my testing, the code comments are correct, and the documentation is incorrect. Version/Build: iOS 11/Xcode 9/macOS Sierra/latest dev docs
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!