From 5a96ef13f66856a19d0d7d07b28c43a27b4d32cb Mon Sep 17 00:00:00 2001 From: John Estropia Date: Wed, 19 Aug 2015 15:07:15 +0900 Subject: [PATCH] added utility to get NSManagedObjectID from an object URI --- CoreStore/Setting Up/DataStack.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CoreStore/Setting Up/DataStack.swift b/CoreStore/Setting Up/DataStack.swift index 8c3bdf6..e435c0a 100644 --- a/CoreStore/Setting Up/DataStack.swift +++ b/CoreStore/Setting Up/DataStack.swift @@ -89,6 +89,14 @@ public final class DataStack { return self.model.entityMapping() } + /** + Returns the `NSManagedObjectID` for the specified object URI if it exists in the persistent store. + */ + public func objectIDForURIRepresentation(url: NSURL) -> NSManagedObjectID? { + + return self.coordinator.managedObjectIDForURIRepresentation(url) + } + /** Adds an in-memory store to the stack.