Fetching by ObjectID #259

Open
opened 2025-12-29 15:27:48 +01:00 by adam · 1 comment
Owner

Originally created by @puelocesar on GitHub (Apr 2, 2019).

I have an uriRepresentation of an NSManagedObject saved somewhere in my app, and I want to fetch that object using CoreStore.
Problem is, NSPersistentStoreCoordinator().managedObjectID(forURIRepresentation: url) always returns nil for me.
Is there a special way of doing this on CoreStore?

Originally created by @puelocesar on GitHub (Apr 2, 2019). I have an uriRepresentation of an NSManagedObject saved somewhere in my app, and I want to fetch that object using CoreStore. Problem is, `NSPersistentStoreCoordinator().managedObjectID(forURIRepresentation: url)` always returns nil for me. Is there a special way of doing this on CoreStore?
Author
Owner

@JohnEstropia commented on GitHub (Apr 12, 2019):

CoreStore doesn't really do anything special here, so there's probably something in the way you're using uriRepresentation.

Are you sure that the uriRepresentation you are saving are not from temporary object IDs?

@JohnEstropia commented on GitHub (Apr 12, 2019): CoreStore doesn't really do anything special here, so there's probably something in the way you're using `uriRepresentation`. Are you sure that the `uriRepresentation` you are saving are not from temporary object IDs?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#259