25 #import "CoreDataHeaders.h"
26 #import "GSPersistentStore.h"
28 @interface NSManagedObjectID (GSCoreDataInternal)
30 + (void) willBecomeMultiThreaded: (NSNotification *) notif;
44 [[NSNotificationCenter defaultCenter]
46 selector: @selector(willBecomeMultiThreaded:)
47 name: NSWillBecomeMultiThreadedNotification
54 TEST_RELEASE(_persistentStore);
55 TEST_RELEASE(_entity);
64 - (NSEntityDescription *)
entity
76 return (_persistentStore == nil);
85 return _persistentStore;
95 if (_persistentStore == nil)
101 NSString * UUID = [[_persistentStore metadata]
102 objectForKey: NSStoreUUIDKey];
104 return [NSURL URLWithString: [NSString stringWithFormat:
105 @"%@/%@/%llX", UUID, [_entity name], _value]];
118 if ([_entity isEqual: [otherID
entity]] == NO)
139 - (BOOL) isEqual: (
id) otherObject
143 return [
self isEqualToManagedObjectID: otherObject];
153 - (id) copyWithZone: (NSZone *) zone
156 _initWithEntity: _entity
157 persistentStore: _persistentStore
163 @implementation NSManagedObjectID (GSCoreDataPrivate)
171 static unsigned long long nextTemporaryID = 0;
176 static NSRecursiveLock * lock = nil;
178 - (id) _initWithEntity: (NSEntityDescription *) entity
180 if ((
self = [super init]))
182 ASSIGN(_entity, entity);
189 _value = nextTemporaryID;
196 _value = nextTemporaryID;
203 - (id) _initWithEntity: (NSEntityDescription *) entity
205 value: (
unsigned long long) value
207 if ((
self = [super init]))
209 ASSIGN(_entity, entity);
210 ASSIGN(_persistentStore, persistentStore);
217 - (
unsigned long long) _value
224 @implementation NSManagedObjectID (GSCoreDataInternal)
231 + (void) willBecomeMultiThreaded: (NSNotification *) notif
233 lock = [NSRecursiveLock new];
235 [[NSNotificationCenter defaultCenter] removeObserver: self];
Nn abstract superclass from which concrete implementations of various persistent store types are subc...
For implementation notes see "Documentation/NSManagedObjectID.txt" in the source distribution of the ...
BOOL isTemporaryID()
Returns NO if the receiver is a permanent ID (that is, it has been already saved to or fetched from a...
id persistentStore()
Returns the persistent store from which the receiver has been fetched or to which it has been stored,...
NSURL * URIRepresentation()
Returns an archivable URI representation of the receiver.
NSEntityDescription * entity()
Returns the receiver's entity (that is, the entity of the object to which this managed object ID belo...