Commits

Anonymous committed 559c681

Add missing files and get compiled without warnings on newer versions of Xcode

Comments (0)

Files changed (7)

+syntax: regexp
+
+\.xcodeproj/.*\.mode1$
+\.xcodeproj/.*\.mode1v3$
+\.xcodeproj/.*\.pbxuser$
+
+syntax: glob
+
+build
+scratch
+.DS_Store
+*.~.nib

MyDocument.xcdatamodel/elements

Binary file modified.

MyDocument.xcdatamodel/layout

Binary file modified.

TaskTracker2.xcodeproj/project.pbxproj

 	objects = {
 
 /* Begin PBXBuildFile section */
+		552E8AD60F93C514002FECE7 /* CoreData+JRExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 552E8AD50F93C514002FECE7 /* CoreData+JRExtensions.m */; };
+		552E8B540F93CD54002FECE7 /* CoreData+PatchRadar4828429.m in Sources */ = {isa = PBXBuildFile; fileRef = 552E8B530F93CD54002FECE7 /* CoreData+PatchRadar4828429.m */; };
 		775BDEF1067A8BF0009058FE /* MyDocument.xcdatamodel in Sources */ = {isa = PBXBuildFile; fileRef = 775BDEF0067A8BF0009058FE /* MyDocument.xcdatamodel */; };
 		775DFF38067A968500C5B868 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; };
-		7928BE5C0B58A21F0000C258 /* CoreData+PatchRadar4828429.m in Sources */ = {isa = PBXBuildFile; fileRef = 7928BE5B0B58A21F0000C258 /* CoreData+PatchRadar4828429.m */; };
 		793B66BE0822817F00D8D69E /* TaskDocumentMO.m in Sources */ = {isa = PBXBuildFile; fileRef = 793B66BD0822817F00D8D69E /* TaskDocumentMO.m */; };
 		793B66C50822818900D8D69E /* TaskMO.m in Sources */ = {isa = PBXBuildFile; fileRef = 793B66C40822818900D8D69E /* TaskMO.m */; };
 		793B66CC0822819700D8D69E /* TaskPeriodMO.m in Sources */ = {isa = PBXBuildFile; fileRef = 793B66CB0822819700D8D69E /* TaskPeriodMO.m */; };
 		79476D820B02EBA90008B0B7 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79476D810B02EBA90008B0B7 /* Carbon.framework */; };
-		79A384360B02579A00386B39 /* CoreData+JRExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 79A384350B02579A00386B39 /* CoreData+JRExtensions.m */; };
 		79E11BBD098CA5AB000E8E93 /* Aqua2_Add_Inactive.tif in Resources */ = {isa = PBXBuildFile; fileRef = 79E11BBA098CA5AB000E8E93 /* Aqua2_Add_Inactive.tif */; };
 		79E11BBE098CA5AB000E8E93 /* Aqua2_Add_Pressed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 79E11BBB098CA5AB000E8E93 /* Aqua2_Add_Pressed.tif */; };
 		79E11BBF098CA5AB000E8E93 /* Aqua2_Add.tif in Resources */ = {isa = PBXBuildFile; fileRef = 79E11BBC098CA5AB000E8E93 /* Aqua2_Add.tif */; };
 		2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
 		2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
 		32DBCF750370BD2300C91783 /* TaskTracker2_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaskTracker2_Prefix.pch; sourceTree = "<group>"; };
+		552E8AD40F93C514002FECE7 /* CoreData+JRExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CoreData+JRExtensions.h"; sourceTree = "<group>"; };
+		552E8AD50F93C514002FECE7 /* CoreData+JRExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CoreData+JRExtensions.m"; sourceTree = "<group>"; };
+		552E8B530F93CD54002FECE7 /* CoreData+PatchRadar4828429.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CoreData+PatchRadar4828429.m"; sourceTree = "<group>"; };
 		775BDEF0067A8BF0009058FE /* MyDocument.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; path = MyDocument.xcdatamodel; sourceTree = "<group>"; };
 		7788DA0506752A1600599AAD /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
-		7928BE5B0B58A21F0000C258 /* CoreData+PatchRadar4828429.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = "CoreData+PatchRadar4828429.m"; path = "../CoreData+PatchRadar4828429/CoreData+PatchRadar4828429.m"; sourceTree = "<group>"; };
 		793B66BC0822817F00D8D69E /* TaskDocumentMO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaskDocumentMO.h; sourceTree = "<group>"; };
 		793B66BD0822817F00D8D69E /* TaskDocumentMO.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaskDocumentMO.m; sourceTree = "<group>"; };
 		793B66C30822818900D8D69E /* TaskMO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaskMO.h; sourceTree = "<group>"; };
 		793B66CA0822819700D8D69E /* TaskPeriodMO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaskPeriodMO.h; sourceTree = "<group>"; };
 		793B66CB0822819700D8D69E /* TaskPeriodMO.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaskPeriodMO.m; sourceTree = "<group>"; };
 		79476D810B02EBA90008B0B7 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = ../../../../../../../../System/Library/Frameworks/Carbon.framework; sourceTree = "<group>"; };
-		79A384340B02579A00386B39 /* CoreData+JRExtensions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "CoreData+JRExtensions.h"; path = "../CoreData+JRExtensions/CoreData+JRExtensions.h"; sourceTree = SOURCE_ROOT; };
-		79A384350B02579A00386B39 /* CoreData+JRExtensions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = "CoreData+JRExtensions.m"; path = "../CoreData+JRExtensions/CoreData+JRExtensions.m"; sourceTree = SOURCE_ROOT; };
 		79E11BBA098CA5AB000E8E93 /* Aqua2_Add_Inactive.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Aqua2_Add_Inactive.tif; sourceTree = "<group>"; };
 		79E11BBB098CA5AB000E8E93 /* Aqua2_Add_Pressed.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Aqua2_Add_Pressed.tif; sourceTree = "<group>"; };
 		79E11BBC098CA5AB000E8E93 /* Aqua2_Add.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Aqua2_Add.tif; sourceTree = "<group>"; };
 			children = (
 				2A37F4ABFDCFA73011CA2CEA /* Classes */,
 				E1B74B1A0667B4A90069E3BA /* Models */,
+				552E8AD30F93C514002FECE7 /* vendor */,
 				2A37F4AFFDCFA73011CA2CEA /* Other Sources */,
 				2A37F4B8FDCFA73011CA2CEA /* Resources */,
 				2A37F4C3FDCFA73011CA2CEA /* Frameworks */,
 				79E11D58098D414E000E8E93 /* IntervalFormatter.h */,
 				79E11D59098D414E000E8E93 /* IntervalFormatter.m */,
 				79E11D82098D440D000E8E93 /* nsenumerate.h */,
-				79A384340B02579A00386B39 /* CoreData+JRExtensions.h */,
-				79A384350B02579A00386B39 /* CoreData+JRExtensions.m */,
-				7928BE5B0B58A21F0000C258 /* CoreData+PatchRadar4828429.m */,
 			);
 			name = Classes;
 			sourceTree = "<group>";
 			name = Frameworks;
 			sourceTree = "<group>";
 		};
+		552E8AD30F93C514002FECE7 /* vendor */ = {
+			isa = PBXGroup;
+			children = (
+				552E8AD40F93C514002FECE7 /* CoreData+JRExtensions.h */,
+				552E8AD50F93C514002FECE7 /* CoreData+JRExtensions.m */,
+				552E8B530F93CD54002FECE7 /* CoreData+PatchRadar4828429.m */,
+			);
+			path = vendor;
+			sourceTree = "<group>";
+		};
 		E1B74B1A0667B4A90069E3BA /* Models */ = {
 			isa = PBXGroup;
 			children = (
 				793B66C50822818900D8D69E /* TaskMO.m in Sources */,
 				793B66CC0822819700D8D69E /* TaskPeriodMO.m in Sources */,
 				79E11D5A098D414E000E8E93 /* IntervalFormatter.m in Sources */,
-				79A384360B02579A00386B39 /* CoreData+JRExtensions.m in Sources */,
-				7928BE5C0B58A21F0000C258 /* CoreData+PatchRadar4828429.m in Sources */,
+				552E8AD60F93C514002FECE7 /* CoreData+JRExtensions.m in Sources */,
+				552E8B540F93CD54002FECE7 /* CoreData+PatchRadar4828429.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				GCC_C_LANGUAGE_STANDARD = c99;
+				GCC_VERSION = 4.0;
+				MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS = YES;
 				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
 			};
 			name = Development;
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				GCC_C_LANGUAGE_STANDARD = c99;
+				GCC_VERSION = 4.0;
+				MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS = YES;
 				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
 			};
 			name = Deployment;
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				GCC_C_LANGUAGE_STANDARD = c99;
+				GCC_VERSION = 4.0;
+				MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS = YES;
 				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
 			};
 			name = Default;

vendor/CoreData+JRExtensions.h

+/*******************************************************************************
+	CoreData+JRExtensions.h
+		Copyright (c) 2006-2007 Jonathan 'Wolf' Rentzsch: <http://rentzsch.com>
+		Some rights reserved: <http://opensource.org/licenses/mit-license.php>
+
+	***************************************************************************/
+
+#import <Cocoa/Cocoa.h>
+
+@interface NSManagedObject (JRExtensions)
++ (id)newInManagedObjectContext:(NSManagedObjectContext*)moc_;
+- (id)initAndInsertIntoManagedObjectContext:(NSManagedObjectContext*)moc_;
+
++ (id)rootObjectInManagedObjectContext:(NSManagedObjectContext*)moc_;
++ (id)rootObjectInManagedObjectContext:(NSManagedObjectContext*)moc_ error:(NSError**)error_;
+
++ (NSArray*)fetchAllInManagedObjectContext:(NSManagedObjectContext*)moc_;
++ (NSArray*)fetchAllInManagedObjectContext:(NSManagedObjectContext*)moc_ error:(NSError**)error_;
+
++ (NSString*)entityNameByHeuristic; // MyCoolObjectMO => @"MyCoolObject".
++ (NSEntityDescription*)entityDescriptionInManagedObjectContext:(NSManagedObjectContext*)moc_;
++ (NSFetchRequest*)fetchRequestForEntityInManagedObjectContext:(NSManagedObjectContext*)moc_;
+
++ (NSString*)defaultSortKeyWithManagedObjectContext:(NSManagedObjectContext*)moc_;
+
+- (NSString*)objectURLID;
+@end
+
+@interface NSManagedObjectContext (JRExtensions)
+- (NSArray*)executeFetchRequestNamed:(NSString*)fetchRequestName_;
+- (NSArray*)executeFetchRequestNamed:(NSString*)fetchRequestName_ error:(NSError**)error_;
+- (NSArray*)executeFetchRequestNamed:(NSString*)fetchRequestName_ substitutionVariables:(NSDictionary*)variables_;
+- (NSArray*)executeFetchRequestNamed:(NSString*)fetchRequestName_ substitutionVariables:(NSDictionary*)variables_ error:(NSError**)error_;
+- (id)executeSingleResultFetchRequestNamed:(NSString*)fetchRequestName_ substitutionVariables:(NSDictionary*)variables_ error:(NSError**)error_;
+
+- (id)objectWithURLID:(NSString*)url_;
+@end
+

vendor/CoreData+JRExtensions.m

+/*******************************************************************************
+	CoreData+JRExtensions.m
+		Copyright (c) 2006-2007 Jonathan 'Wolf' Rentzsch: <http://rentzsch.com>
+		Some rights reserved: <http://opensource.org/licenses/mit-license.php>
+
+	***************************************************************************/
+
+#import "CoreData+JRExtensions.h"
+
+@implementation NSManagedObject (JRExtensions)
+
++ (id)newInManagedObjectContext:(NSManagedObjectContext*)moc_ {
+	return [[self alloc] initAndInsertIntoManagedObjectContext:moc_];
+}
+
+- (id)initAndInsertIntoManagedObjectContext:(NSManagedObjectContext*)moc_ {
+	return [NSEntityDescription insertNewObjectForEntityForName:[[[self class] entityDescriptionInManagedObjectContext:moc_] name]
+										 inManagedObjectContext:moc_];
+}
+
++ (id)rootObjectInManagedObjectContext:(NSManagedObjectContext*)moc_ error:(NSError**)error_ {
+	NSError *error = nil;
+	NSArray *objects = [moc_ executeFetchRequest:[self fetchRequestForEntityInManagedObjectContext:moc_] error:&error];
+	NSAssert( objects, @"-[NSManagedObjectContext executeFetchRequest] returned nil" );
+	
+	id result = nil;
+	
+	switch( [objects count] ) {
+		case 0:
+			[[moc_ undoManager] disableUndoRegistration];
+			result = [self newInManagedObjectContext:moc_];
+			[moc_ processPendingChanges];
+			[[moc_ undoManager] enableUndoRegistration];
+			break;
+		case 1:
+			result = [objects objectAtIndex:0];
+			break;
+		default:
+			NSAssert2( NO, @"0 or 1 %@ objects expected, %d found", [self className], [objects count] );
+	}
+	
+	if (error_) {
+		*error_ = error;
+	}
+	
+	return result;
+}
+
++ (id)rootObjectInManagedObjectContext:(NSManagedObjectContext*)moc_ {
+	NSError *error = nil;
+	id result = [self rootObjectInManagedObjectContext:moc_ error:&error];
+	if (error) {
+		[NSApp presentError:error];
+	}
+	return result;
+}
+
++ (NSString*)entityNameByHeuristic {
+	NSString *result = [self className];
+	if( [result hasSuffix:@"MO"] ) {
+		result = [result substringToIndex:([result length]-2)];
+	}
+	return result;
+}
+
++ (NSEntityDescription*)entityDescriptionInManagedObjectContext:(NSManagedObjectContext*)moc_ {
+	NSEntityDescription *result = [NSEntityDescription entityForName:[self entityNameByHeuristic] inManagedObjectContext:moc_];
+	if( nil == result ) {
+		// Heuristic failed. Do it the hard way.
+		NSString *className = [self className];
+		NSManagedObjectModel *managedObjectModel = [[moc_ persistentStoreCoordinator] managedObjectModel];
+		NSArray *entities = [managedObjectModel entities];
+		unsigned entityIndex = 0, entityCount = [entities count];
+		for( ; nil == result && entityIndex < entityCount; ++entityIndex ) {
+			if( [[[entities objectAtIndex:entityIndex] managedObjectClassName] isEqualToString:className] ) {
+				result = [entities objectAtIndex:entityIndex];
+			}
+		}
+		NSAssert1( result, @"no entity found with a managedObjectClassName of %@", className );
+	}
+	return result;
+}
+
++ (NSFetchRequest*)fetchRequestForEntityInManagedObjectContext:(NSManagedObjectContext*)moc_ {
+	NSFetchRequest *result = [[[NSFetchRequest alloc] init] autorelease];
+	[result setEntity:[self entityDescriptionInManagedObjectContext:moc_]];
+	NSString *defaultSortKey = [self defaultSortKeyWithManagedObjectContext:moc_];
+	if (defaultSortKey) {
+		[result setSortDescriptors:[NSArray arrayWithObject:[[[NSSortDescriptor alloc] initWithKey:defaultSortKey ascending:YES] autorelease]]];
+	}
+	return result;
+}
+
++ (NSArray*)fetchAllInManagedObjectContext:(NSManagedObjectContext*)moc_ {
+	NSError *error = nil;
+	NSArray *result = [self fetchAllInManagedObjectContext:moc_ error:nil];
+	if (error) {
+		[NSApp presentError:error];
+	}
+	return result;
+}
+
++ (NSArray*)fetchAllInManagedObjectContext:(NSManagedObjectContext*)moc_ error:(NSError**)error_ {
+	return [moc_ executeFetchRequest:[self fetchRequestForEntityInManagedObjectContext:moc_]
+							   error:error_];
+}
+
++ (NSString*)defaultSortKeyWithManagedObjectContext:(NSManagedObjectContext*)moc_ {
+	NSString *result = nil;
+	NSEntityDescription *entityDesc = [self entityDescriptionInManagedObjectContext:moc_];
+	if (entityDesc) {
+		result = [[entityDesc userInfo] objectForKey:@"defaultSortKey"];
+		if (!result && [[[entityDesc propertiesByName] allKeys] containsObject:@"position_"]) {
+			result = @"position_";
+		}
+	}
+	return result;
+}
+
+- (NSString*)objectURLID {
+	return [[[self objectID] URIRepresentation] absoluteString];
+}
+
+@end
+
+@implementation NSManagedObjectContext (JRExtensions)
+
+- (NSArray*)executeFetchRequestNamed:(NSString*)fetchRequestName_ {
+	return [self executeFetchRequestNamed:fetchRequestName_ substitutionVariables:nil];
+}
+
+- (NSArray*)executeFetchRequestNamed:(NSString*)fetchRequestName_ error:(NSError**)error_ {
+	return [self executeFetchRequestNamed:fetchRequestName_ substitutionVariables:nil error:error_];
+}
+
+- (NSArray*)executeFetchRequestNamed:(NSString*)fetchRequestName_ substitutionVariables:(NSDictionary*)variables_ {
+	NSError *error = nil;
+	NSArray *result = [self executeFetchRequestNamed:fetchRequestName_ substitutionVariables:variables_ error:&error];
+	if (error) {
+		[NSApp presentError:error];
+	}
+	return result;
+}
+
+#define FetchRequestSortDescriptorsSeemsBroken	1
+
+- (NSArray*)executeFetchRequestNamed:(NSString*)fetchRequestName_ substitutionVariables:(NSDictionary*)variables_ error:(NSError**)error_ {
+	NSManagedObjectModel *model = [[self persistentStoreCoordinator] managedObjectModel];
+	NSFetchRequest *fetchRequest = [model fetchRequestFromTemplateWithName:fetchRequestName_
+													 substitutionVariables:variables_ ? variables_ : [NSDictionary dictionary]];
+	NSAssert1(fetchRequest, @"Can't find fetch request named \"%@\".", fetchRequestName_);
+	
+	NSString *defaultSortKey = nil;
+	Class entityClass = NSClassFromString([[fetchRequest entity] managedObjectClassName]);
+	if ([entityClass respondsToSelector:@selector(defaultSortKeyWithManagedObjectContext:)]) {
+		defaultSortKey = [entityClass defaultSortKeyWithManagedObjectContext:self];
+	}
+	
+#if !FetchRequestSortDescriptorsSeemsBroken
+	if (defaultSortKey) {
+		NSAssert([[fetchRequest sortDescriptors] count] == 0, @"Model-based fetch requests can't have sortDescriptors.");
+		[fetchRequest setSortDescriptors:[NSArray arrayWithObject:[[[NSSortDescriptor alloc] initWithKey:defaultSortKey ascending:YES] autorelease]]];
+	}
+#endif
+	
+	NSArray *result = [self executeFetchRequest:fetchRequest error:error_];
+	
+#if FetchRequestSortDescriptorsSeemsBroken
+	if (defaultSortKey) {
+		result = [result sortedArrayUsingDescriptors:[NSArray arrayWithObject:[[[NSSortDescriptor alloc] initWithKey:defaultSortKey ascending:YES] autorelease]]];
+	}
+#endif
+	return result;
+}
+
+- (id)executeSingleResultFetchRequestNamed:(NSString*)fetchRequestName_ substitutionVariables:(NSDictionary*)variables_ error:(NSError**)error_ {
+	id		result = nil;
+	NSError	*error = nil;
+	
+	NSArray *objects = [self executeFetchRequestNamed:fetchRequestName_ substitutionVariables:variables_ error:&error];
+	NSAssert(objects, nil);
+	
+	if (!error) {
+		switch ([objects count]) {
+			case 0:
+				//	Nothing found matching the fetch request. That's cool, though: we'll just return nil.
+				break;
+			case 1:
+				result = [objects objectAtIndex:0];
+				break;
+			default:
+				NSAssert2(NO, @"%@: 0 or 1 objects expected, %u found", fetchRequestName_, [objects count]);
+		}
+	}
+	
+	if (error_) *error_ = error;
+	return result;
+}
+
+- (id)objectWithURLID:(NSString*)url_ {
+	NSParameterAssert(url_);
+	NSURL *url = [NSURL URLWithString:url_];
+	NSAssert1(url, @"[NSURL URLWithString:@\"%@\"] failed", url_);
+	NSManagedObjectID *objectID = [[self persistentStoreCoordinator] managedObjectIDForURIRepresentation:url];
+	return objectID ? [self objectRegisteredForID:objectID] : nil;
+}
+
+@end

vendor/CoreData+PatchRadar4828429.m

+//	It appears NSManagedObjectModel prematurely releases its references to NSEntityDescriptions, causing weirdness and/or
+//	crashes (chiefly with model-based fetch requests).
+//	This poser tail-patches two bottleneck methods which seem to cover all my code paths, enabling the use of model-based
+//	fetch requests.
+
+#ifndef NSAppKitVersionNumber10_4
+#define NSAppKitVersionNumber10_4 824
+#endif
+
+@interface NSManagedObjectModel_PatchRadar4828429 : NSManagedObjectModel
+@end
+@implementation NSManagedObjectModel_PatchRadar4828429
++ (void)load {
+	if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_4) {
+		//	On a 10.4 - 10.4.x system, need to load this patch.
+		[NSManagedObjectModel_PatchRadar4828429 poseAsClass:[NSManagedObjectModel class]];
+	}
+}
+- (id)initWithCoder:(NSCoder*)decoder_ {
+	self = [super initWithCoder:decoder_];
+	[[self entities] makeObjectsPerformSelector:@selector(retain)];
+	return self;
+}
+- (NSFetchRequest*)fetchRequestFromTemplateWithName:(NSString*)name_ substitutionVariables:(NSDictionary*)variables_ {
+	NSFetchRequest *fetchRequest = [super fetchRequestFromTemplateWithName:name_ substitutionVariables:variables_];
+	[fetchRequest setEntity:[[self entitiesByName] objectForKey:[[fetchRequest entity] name]]];
+	return fetchRequest;
+}
+@end