iOS 14b1: The new Swift notification constants e.g. NSManagedObjectContext.didChangeObjectsNotification have wrong strings

Originator:indiekiduk
Number:rdar://FB7844928 Date Originated:3/7/20
Status:Open Resolved:No
Product:iOS Product Version:14b1
Classification:Incorrect/Unexpected Behavior Reproducible:Always
 
Which area are you seeing an issue with?
Core Data API

Is this Feedback related to a Lab, Engineering Session, or Forum Topic from WWDC20?
Yes, an Engineering Session

Please provide the session title:
Core Data: Sundries and maxims

I noticed the new constants shown on the slide at 13:44 in the video for this session wwdc2020_10017_hd.mp4 aren't working correctly and I figured out why.

// new notification constant
let a1 = NSManagedObjectContext.didChangeObjectsNotification
print(a1)
        
outputs:
NSNotificationName(_rawValue: NSManagedObjectContextObjectsDidChangeNotification)

Which looks ok but in fact the string is wrong, meaning observing the notification doesn't work. To see the correct string we can output the old version of the constant:

        // old notification constant
        let a2 = NSNotification.Name.NSManagedObjectContextObjectsDidChange
        print(a2)

NSNotificationName(_rawValue: NSObjectsChangedInManagingContextNotification)

As you can see the correct string is "NSObjectsChangedInManagingContextNotification" and observing this does work.

Also, it appears all of the other new constants need fixed too.

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!