I create a new document where some of the dictionary values are NSNumber.
Later I want to compare a possible new document so read the old one using this code…
CBLDocument *oldDoc = [database existingDocumentWithID:documentId]; NSDictionary *oldDict = oldDoc.userProperties;
Some of the returned values are an NSTaggedPointerString rather than NSNumber.
Interesting when restarting the app all numeric values are returned as NSNumber.
The NSTaggedPointerString values are numbers that are used repeatedly, so it’s an in memory Objective C optimisation.
The problem is that NSDictionary isEqual fails because NSTaggedPointerString is an NSString type rather than an NSNumber.
This project runs into a similar thing where NSNumber values end up returning NSTaggedPointerString. They discuss using a NSValueTransformer.
I can write my own isEqual routine but any ideas to help? As I think this is a bug getting back a completely different class.