Changeset 282
- Timestamp:
- 01/17/08 07:56:25 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cocoa/mogenerator/templates/machine.h.motemplate
r281 r282 10 10 11 11 @interface _<$managedObjectClassName$> : <$customSuperentity$> {} 12 + (id)newInManagedObjectContext:(NSManagedObjectContext*)moc_; 13 12 14 <$foreach Attribute noninheritedAttributes do$> 13 15 <$if Attribute.hasDefinedAttributeType$> 14 16 - (<$Attribute.attributeValueClassName$>*)<$Attribute.name$>; 15 17 - (void)set<$Attribute.name.initialCapitalString$>:(<$Attribute.attributeValueClassName$>*)value_; 18 #if defined(MAC_OS_X_VERSION_10_5) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 19 @property (retain) <$Attribute.attributeValueClassName$> *<$Attribute.name$>; 20 #endif 16 21 <$if Attribute.hasScalarAttributeType$> 17 22 - (<$Attribute.scalarAttributeType$>)<$Attribute.name$>Value; … … 23 28 <$foreach Relationship noninheritedRelationships do$> 24 29 <$if Relationship.isToMany$> 30 - (NSSet*)<$Relationship.name$>; 25 31 - (void)add<$Relationship.name.initialCapitalString$>:(NSSet*)value_; 26 32 - (void)remove<$Relationship.name.initialCapitalString$>:(NSSet*)value_; … … 28 34 - (void)remove<$Relationship.name.initialCapitalString$>Object:(<$Relationship.destinationEntity.managedObjectClassName$>*)value_; 29 35 - (NSMutableSet*)<$Relationship.name$>Set; 36 #if defined(MAC_OS_X_VERSION_10_5) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 37 @property (retain) NSSet* <$Relationship.name$>; 38 #endif 30 39 <$else$> 31 40 - (<$Relationship.destinationEntity.managedObjectClassName$>*)<$Relationship.name$>; 32 41 - (void)set<$Relationship.name.initialCapitalString$>:(<$Relationship.destinationEntity.managedObjectClassName$>*)value_; 33 42 //- (BOOL)validate<$Relationship.name.initialCapitalString$>:(id*)value_ error:(NSError**)error_; 43 #if defined(MAC_OS_X_VERSION_10_5) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 44 @property (retain) <$Relationship.destinationEntity.managedObjectClassName$>* <$Relationship.name$>; 45 #endif 34 46 <$endif$> 35 47 <$endforeach do$> trunk/cocoa/mogenerator/templates/machine.m.motemplate
r281 r282 5 5 6 6 @implementation _<$managedObjectClassName$> 7 8 + (id)newInManagedObjectContext:(NSManagedObjectContext*)moc_ { 9 return [NSEntityDescription insertNewObjectForEntityForName:@"<$name$>" inManagedObjectContext:moc_]; 10 } 11 7 12 <$foreach Attribute noninheritedAttributes do$> 8 13 <$if Attribute.hasDefinedAttributeType$> … … 38 43 <$foreach Relationship noninheritedRelationships do$> 39 44 <$if Relationship.isToMany$> 45 46 - (NSSet*)<$Relationship.name$> { 47 [self willAccessValueForKey:@"<$Relationship.name$>"]; 48 NSSet *result = [self primitiveValueForKey:@"<$Relationship.name$>"]; 49 [self didAccessValueForKey:@"<$Relationship.name$>"]; 50 return result; 51 } 52 53 - (void)set<$Relationship.name.initialCapitalString$>:(NSSet*)value_ { 54 [self willChangeValueForKey:@"<$Relationship.name$>"]; 55 [self setPrimitiveValue:value_ forKey:@"<$Relationship.name$>"]; 56 [self didChangeValueForKey:@"<$Relationship.name$>"]; 57 } 58 40 59 - (void)add<$Relationship.name.initialCapitalString$>:(NSSet*)value_ { 41 60 [self willChangeValueForKey:@"<$Relationship.name$>" withSetMutation:NSKeyValueUnionSetMutation usingObjects:value_];
