Permalink
Browse files

Fixed bugs 8, 10, and 11; added machine-generated primitive accessors…

… credit to my colleague paugus. Project was using 10.4 SDK, now uses Base SDK. Fixed some warnings. Removed some 10.4 support.
  • Loading branch information...
1 parent daa2a75 commit fbb156268d2a6fd5668fe43dc4c815ddeca4b1d8 @seanm committed Jul 21, 2010
@@ -584,7 +584,7 @@ - (MiscMergeCommandExitType)executeCommandBlock:(MiscMergeCommandBlock *)block
}
[commandStack removeLastObject];
- [localPool release];
+ [localPool drain];
return exitCode;
}
@@ -548,7 +548,7 @@ - (void)parseString:(NSString *)string
[self _addBetweenString:[[accumString copy] autorelease]];
}
- [localPool release];
+ [localPool drain];
}
@end
@@ -26,7 +26,6 @@ enum
@interface NSCharacterSet (MiscAdditions)
+ (NSCharacterSet *)allWhitespaceCharacterSet;
-+ (NSCharacterSet *)newlineCharacterSet;
@end
@@ -38,16 +38,6 @@ + (NSCharacterSet *)allWhitespaceCharacterSet
return whiteSet;
}
-+ (NSCharacterSet *)newlineCharacterSet
-{
- static NSCharacterSet *newlineSet = nil;
-
- if (newlineSet == nil)
- newlineSet = [[NSCharacterSet characterSetWithCharactersInString:@"\n\r"] retain];
-
- return newlineSet;
-}
-
@end
@@ -111,6 +111,6 @@ int DDCliAppRunWithClass(Class delegateClass)
// Initialize singleton/global
DDCliApplication * app = [DDCliApplication sharedApplication];
int result = [app runWithClass: delegateClass];
- [pool release];
+ [pool drain];
return result;
}
View
@@ -33,6 +33,7 @@
- (NSString*)scalarAttributeType;
- (BOOL)hasDefinedAttributeType;
- (NSString*)objectAttributeType;
+- (BOOL)hasTransformableAttributeType;
@end
@interface NSString (camelCaseString)
View
@@ -242,16 +242,18 @@ - (BOOL)hasDefinedAttributeType {
return [self attributeType] != NSUndefinedAttributeType;
}
- (NSString*)objectAttributeType {
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
- #define NSTransformableAttributeType 1800
-#endif
- if ([self attributeType] == NSTransformableAttributeType) {
+ if ([self hasTransformableAttributeType]) {
NSString *result = [[self userInfo] objectForKey:@"attributeValueClassName"];
return result ? result : @"NSObject";
} else {
return [self attributeValueClassName];
}
}
+
+- (BOOL)hasTransformableAttributeType {
+ return ([self attributeType] == NSTransformableAttributeType);
+}
+
@end
@implementation NSString (camelCaseString)
@@ -460,7 +460,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
- SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ SDKROOT = "";
};
name = Debug;
};
@@ -473,7 +473,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
- SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ SDKROOT = "";
};
name = Release;
};
@@ -6,6 +6,8 @@
<$foreach Relationship noninheritedRelationships do$>@class <$Relationship.destinationEntity.managedObjectClassName$>;
<$endforeach do$>
+<$foreach Attribute noninheritedAttributes do$><$if Attribute.hasTransformableAttributeType$>@class <$Attribute.objectAttributeType$>;<$endif$>
+<$endforeach do$>
@interface <$managedObjectClassName$>ID : NSManagedObjectID {}
@end
@@ -54,3 +56,23 @@
- (void)remove<$Relationship.name.initialCapitalString$>Object:(<$Relationship.destinationEntity.managedObjectClassName$>*)value_;
<$endif$><$endforeach do$>
@end
+
+@interface _<$managedObjectClassName$> (CoreDataGeneratedPrimitiveAccessors)
+<$foreach Attribute noninheritedAttributes do$>
+- (<$Attribute.objectAttributeType$>*)primitive<$Attribute.name.initialCapitalString$>;
+- (void)setPrimitive<$Attribute.name.initialCapitalString$>:(<$Attribute.objectAttributeType$>*)value;
+<$if Attribute.hasScalarAttributeType$>
+- (<$Attribute.scalarAttributeType$>)primitive<$Attribute.name.initialCapitalString$>Value;
+- (void)setPrimitive<$Attribute.name.initialCapitalString$>Value:(<$Attribute.scalarAttributeType$>)value_;
+<$endif$>
+<$endforeach do$>
+<$foreach Relationship noninheritedRelationships do$>
+<$if Relationship.isToMany$>
+- (NSMutableSet*)primitive<$Relationship.name.initialCapitalString$>;
+- (void)setPrimitive<$Relationship.name.initialCapitalString$>:(NSMutableSet*)value;
+<$else$>
+- (<$Relationship.destinationEntity.managedObjectClassName$>*)primitive<$Relationship.name.initialCapitalString$>;
+- (void)setPrimitive<$Relationship.name.initialCapitalString$>:(<$Relationship.destinationEntity.managedObjectClassName$>*)value;
+<$endif$>
+<$endforeach do$>
+@end
@@ -35,13 +35,21 @@
- (<$Attribute.scalarAttributeType$>)<$Attribute.name$>Value {
NSNumber *result = [self <$Attribute.name$>];
- return result ? [result <$Attribute.scalarAttributeType.camelCaseString$>Value] : 0;
+ return [result <$Attribute.scalarAttributeType.camelCaseString$>Value];
}
- (void)set<$Attribute.name.initialCapitalString$>Value:(<$Attribute.scalarAttributeType$>)value_ {
[self set<$Attribute.name.initialCapitalString$>:[NSNumber numberWith<$Attribute.scalarAttributeType.camelCaseString.initialCapitalString$>:value_]];
}
+- (<$Attribute.scalarAttributeType$>)primitive<$Attribute.name.initialCapitalString$>Value {
+ NSNumber *result = [self primitive<$Attribute.name.initialCapitalString$>];
+ return [result <$Attribute.scalarAttributeType.camelCaseString$>Value];
+}
+
+- (void)setPrimitive<$Attribute.name.initialCapitalString$>Value:(<$Attribute.scalarAttributeType$>)value_ {
+ [self setPrimitive<$Attribute.name.initialCapitalString$>:[NSNumber numberWith<$Attribute.scalarAttributeType.camelCaseString.initialCapitalString$>:value_]];
+}
<$endif$>
<$endif$>
<$endforeach do$>

0 comments on commit fbb1562

Please sign in to comment.