Post marked as unsolved
Click to stop watching this post.
You have stopped watching this post. Click to start watching again.
Post marked as unsolved with 5 replies
556
Views
Why Xcode 12.5 errs when using Class as a key in NSDictionary?
I downloaded Xcode 12.5 Beta and now an existing project does not compile with errors telling I can't use Class as a key in NSDictionary.
Cannot initialize a parameter of type 'id<NSCopying> _Nonnull const __unsafe_unretained' with an rvalue of type 'Class'
I have assumes so far that while Class does not conform to NSCopying, it is safe to use as a dictionary key because it implements copy and copyWithZone:.
Did anything change with that regard in the compiler/runtime shipped with Xcode 12.5? Is it safe (and endorsed practice) to cast to id<NSCopying> to silence these errors?