I have a CoreData-based app that's many years old, so it's been a long time since I've actually dealt with CoreData. Over recent years, I've noticed that fetch requests aren't finding the object I know is in there. The entity is called Folder and has a single attribute named url, which is of type Transformable. The transformer is a custom one that converts a url into a dictionary with 2 keys; one is a security scoped bookmark created from the url, and the other is the original url in case the bookmark fails. The dictionary is then converted to NSData using NSKeyedArchiver securely.
The reverseTransformedValue does the opposite; unarchives the data to a dict, attempts to resolve the bookmark back into the url.
The fetch request is set up to fetch all Folder objects where: Custom Predicate: url == $THE_URL
So is the fetch request comparing the NSData that's stored in the file and comparing that to $THE_URL after running it through the transformer to arrive at an NSData, or is it running each one through the transformer to get the underlying url and comparing those with $THE_URL?
Could there be a better way to compare urls in Core Data, when the app is sandboxed and must use security scoped bookmarks?