Permalink
Browse files

Reverted PonsoTest to version on rentzsch/master

  • Loading branch information...
1 parent 29b5156 commit 25b700a355065756ac6135db323937bbb508d044 @tyrone-sudeium committed Nov 30, 2011
Showing with 283 additions and 631 deletions.
  1. +1 −2 contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/PonsoTest.xcodeproj/project.pbxproj
  2. +1 −0 contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/Model.h
  3. +3 −11 contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelAssistant.h
  4. +41 −101 contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelAssistant.m
  5. +7 −15 contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelCompany.h
  6. +66 −109 contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelCompany.m
  7. +5 −13 ...ributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelDepartment.h
  8. +58 −105 ...ributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelDepartment.m
  9. +1 −7 ...emplates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelDepartmentAssistant.h
  10. +27 −72 ...emplates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelDepartmentAssistant.m
  11. +1 −7 ...templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelDepartmentEmployee.h
  12. +27 −72 ...templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelDepartmentEmployee.m
  13. +3 −11 contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelEmployee.h
  14. +42 −106 contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelEmployee.m
@@ -188,7 +188,6 @@
457C267F1399FAC600BF00DD /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0420;
ORGANIZATIONNAME = "@nzhuk";
};
buildConfigurationList = 457C26821399FAC600BF00DD /* Build configuration list for PBXProject "PonsoTest" */;
@@ -220,7 +219,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "### Settings\n\nDATA_MODEL_FILE=\"$PROJECT_DIR/MyModel.xcdatamodeld/MyModel.xcdatamodel\"\nDATA_MODEL_SOURCE_DIR=\"$PROJECT_DIR/Sources/DataModel\"\n\nBASE_CLASS=\"ModelObject\"\nAGGREGATE_HEADER=\"$DATA_MODEL_SOURCE_DIR/Model.h\"\n\nMOGENERATOR_DIR=\"$PROJECT_DIR/../../../../../\"\nMOGENERATOR_BIN=`type -P mogenerator` ## Adjust this so that it points to a compiled mogenerator binary.\nMOGENERATOR_TEMPLATES=\"$MOGENERATOR_DIR/contributed templates/Nikita Zhuk/ponso/templates/NSSet/NSCoding\"\n\n### Logic\n\nsource \"$MOGENERATOR_DIR/ponso/generate.sh\"\n";
+ shellScript = "### Settings\n\nDATA_MODEL_FILE=\"$PROJECT_DIR/MyModel.xcdatamodeld/MyModel.xcdatamodel\"\nDATA_MODEL_SOURCE_DIR=\"$PROJECT_DIR/Sources/DataModel\"\n\nBASE_CLASS=\"ModelObject\"\nAGGREGATE_HEADER=\"$DATA_MODEL_SOURCE_DIR/Model.h\"\n\nMOGENERATOR_DIR=\"$PROJECT_DIR/../../../../../\"\nMOGENERATOR_BIN=\"$MOGENERATOR_DIR/mogenerator\" ## Adjust this so that it points to a compiled mogenerator binary.\nMOGENERATOR_TEMPLATES=\"$MOGENERATOR_DIR/contributed templates/Nikita Zhuk/ponso/templates\"\n\n### Logic\n\nsource \"$MOGENERATOR_DIR/ponso/generate.sh\"\n";
};
/* End PBXShellScriptBuildPhase section */
@@ -4,3 +4,4 @@
#import "ModelDepartmentAssistant.h"
#import "ModelDepartmentEmployee.h"
#import "ModelEmployee.h"
+
@@ -10,7 +10,6 @@
#import <Foundation/Foundation.h>
#import "ModelObject.h"
-#import "ModelObject.h"
@class ModelEmployee;
@class ModelCompany;
@@ -22,7 +21,7 @@
@end
-@interface _ModelAssistant : ModelObject <NSCoding>
+@interface _ModelAssistant : ModelObject
{
NSDate *birthDate;
NSString *name;
@@ -32,7 +31,7 @@
ModelCompany *company;
- NSSet *departments;
+ NSArray *departments;
}
@@ -43,21 +42,14 @@
@property (nonatomic, assign, readwrite) ModelCompany *company;
-@property (nonatomic, retain, readonly) NSSet *departments;
+@property (nonatomic, retain, readonly) NSArray *departments;
-- (void)addDepartmentsObject:(ModelDepartmentAssistant*)value_ settingInverse: (BOOL) setInverse;
- (void)addDepartmentsObject:(ModelDepartmentAssistant*)value_;
- (void)removeDepartmentsObjects;
-- (void)removeDepartmentsObject:(ModelDepartmentAssistant*)value_ settingInverse: (BOOL) setInverse;
- (void)removeDepartmentsObject:(ModelDepartmentAssistant*)value_;
-- (void) setBoss: (ModelEmployee*) boss_ settingInverse: (BOOL) setInverse;
-
-- (void) setCompany: (ModelCompany*) company_ settingInverse: (BOOL) setInverse;
-
-
@end
@@ -7,70 +7,36 @@
// Make changes to ModelAssistant.h instead.
//
-
#import "_ModelAssistant.h"
#import "ModelEmployee.h"
#import "ModelCompany.h"
#import "ModelDepartmentAssistant.h"
+
@interface _ModelAssistant()
-@property (nonatomic, retain, readwrite) NSSet *departments;
+@property (nonatomic, retain, readwrite) NSArray *departments;
+
@end
/** \ingroup DataModel */
-NS_INLINE NSMutableSet* NonretainingNSMutableSetMake()
-{
- CFSetCallBacks callbacks = {0, NULL, NULL, CFCopyDescription, CFEqual, CFHash};
- return [(NSMutableSet*) CFSetCreateMutable(0, 0, &callbacks) autorelease];
-}
-
@implementation _ModelAssistant
+
- (id)init
{
if((self = [super init]))
{
+
}
return self;
}
-- (id) initWithCoder: (NSCoder*) aDecoder
-{
- if ([[super class] instancesRespondToSelector: @selector(initWithCoder:)]) {
- self = [super initWithCoder: aDecoder];
- } else {
- self = [super init];
- }
- if (self) {
- self.birthDate = [aDecoder decodeObjectForKey: @"birthDate"];
- self.name = [aDecoder decodeObjectForKey: @"name"];
- self.boss = [aDecoder decodeObjectForKey: @"boss"];
- self.company = [aDecoder decodeObjectForKey: @"company"];
- {
- NSSet *set = [aDecoder decodeObjectForKey: @"departments"];
- NSMutableSet *nonretainingSet = NonretainingNSMutableSetMake();
- [nonretainingSet unionSet: set];
- self.departments = nonretainingSet;
- }
- }
- return self;
-}
-
-- (void) encodeWithCoder: (NSCoder*) aCoder
-{
- [super encodeWithCoder: aCoder];
- [aCoder encodeObject: self.birthDate forKey: @"birthDate"];
- [aCoder encodeObject: self.name forKey: @"name"];
- [aCoder encodeObject: self.boss forKey: @"boss"];
- [aCoder encodeObject: self.company forKey: @"company"];
- [aCoder encodeObject: self.departments forKey: @"departments"];
-}
-
#pragma mark Scalar values
+
#pragma mark Dictionary representation
- (id)initWithDictionaryRepresentation:(NSDictionary *)dictionary
@@ -79,6 +45,8 @@ - (id)initWithDictionaryRepresentation:(NSDictionary *)dictionary
{
self.birthDate = [dictionary objectForKey:@"ModelAssistant.birthDate"];
self.name = [dictionary objectForKey:@"ModelAssistant.name"];
+
+
}
return self;
@@ -89,9 +57,21 @@ - (NSDictionary *)dictionaryRepresentation
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[super dictionaryRepresentation]];
[dict setObjectIfNotNil:self.birthDate forKey:@"ModelAssistant.birthDate"];
[dict setObjectIfNotNil:self.name forKey:@"ModelAssistant.name"];
+
+
+
+
+
+
+
+
+
if([self.departments count] > 0)
{
+
}
+
+
return dict;
}
@@ -101,99 +81,59 @@ - (void)awakeFromDictionaryRepresentationInit
return; // awakeFromDictionaryRepresentationInit has been already executed on this object.
+
+
+
+
[super awakeFromDictionaryRepresentationInit];
}
#pragma mark Direct access
-- (void)addDepartmentsObject:(ModelDepartmentAssistant*)value_ settingInverse: (BOOL) setInverse
+
+- (void)addDepartmentsObject:(ModelDepartmentAssistant*)value_
{
- if(self.departments == nil)
+ if(self.departments == nil)
{
- self.departments = NonretainingNSMutableSetMake();
+ self.departments = [NSMutableArray array];
}
- [(NSMutableSet *)self.departments addObject:value_];
- if (setInverse == YES) {
- [value_ setAssistant: (ModelAssistant*)self settingInverse: NO];
- }
-}
-
-- (void)addDepartmentsObject:(ModelDepartmentAssistant*)value_
-{
- [self addDepartmentsObject:(ModelDepartmentAssistant*)value_ settingInverse: YES];
+ [(NSMutableArray *)self.departments addObject:value_];
+ value_.assistant = (ModelAssistant*)self;
}
- (void)removeDepartmentsObjects
{
- self.departments = NonretainingNSMutableSetMake();
-}
-
-- (void)removeDepartmentsObject:(ModelDepartmentAssistant*)value_ settingInverse: (BOOL) setInverse
-{
- if (setInverse == YES) {
- [value_ setAssistant: nil settingInverse: NO];
- }
- [(NSMutableSet *)self.departments removeObject:value_];
+ self.departments = [NSMutableArray array];
}
- (void)removeDepartmentsObject:(ModelDepartmentAssistant*)value_
{
- [self removeDepartmentsObject:(ModelDepartmentAssistant*)value_ settingInverse: YES];
-}
-
-- (void) setBoss: (ModelEmployee*) boss_ settingInverse: (BOOL) setInverse
-{
- if (boss_ == nil && setInverse == YES) {
- [boss setAssistant: nil settingInverse: NO];
- }
- boss = boss_;
- if (setInverse == YES) {
- [boss setAssistant: (ModelAssistant*)self settingInverse: NO];
- }
+ value_.assistant = nil;
+ [(NSMutableArray *)self.departments removeObject:value_];
}
-- (void) setBoss: (ModelEmployee*) boss_
-{
- [self setBoss: boss_ settingInverse: YES];
-}
-
-- (ModelEmployee*) boss{
- return boss;
-}
-
-- (void) setCompany: (ModelCompany*) company_ settingInverse: (BOOL) setInverse
-{
- if (company_ == nil && setInverse == YES) {
- [company removeAssistantsObject: (ModelAssistant*)self settingInverse: NO];
- }
- company = company_;
- if (setInverse == YES) {
- [company addAssistantsObject: (ModelAssistant*)self settingInverse: NO];
- }
-}
-
-- (void) setCompany: (ModelCompany*) company_
-{
- [self setCompany: company_ settingInverse: YES];
-}
-
-- (ModelCompany*) company{
- return company;
-}
- (void)dealloc
{
self.birthDate = nil;
self.name = nil;
+
+ self.boss = nil;
+ self.company = nil;
+ self.departments = nil;
+
[super dealloc];
}
#pragma mark Synthesizes
@synthesize birthDate;
@synthesize name;
+
+@synthesize boss;
+@synthesize company;
@synthesize departments;
@end
@@ -10,7 +10,6 @@
#import <Foundation/Foundation.h>
#import "ModelObject.h"
-#import "ModelObject.h"
@class ModelAssistant;
@class ModelDepartment;
@@ -22,47 +21,40 @@
@end
-@interface _ModelCompany : ModelObject <NSCoding>
+@interface _ModelCompany : ModelObject
{
NSString *name;
NSNumber *yearFounded;
- NSSet *assistants;
+ NSArray *assistants;
- NSSet *departments;
+ NSArray *departments;
- NSSet *employees;
+ NSArray *employees;
}
@property (nonatomic, retain, readwrite) NSString *name;
@property (nonatomic, retain, readwrite) NSNumber *yearFounded;
@property (nonatomic, assign, readwrite) int yearFoundedValue;
-@property (nonatomic, retain, readonly) NSSet *assistants;
-@property (nonatomic, retain, readonly) NSSet *departments;
-@property (nonatomic, retain, readonly) NSSet *employees;
+@property (nonatomic, retain, readonly) NSArray *assistants;
+@property (nonatomic, retain, readonly) NSArray *departments;
+@property (nonatomic, retain, readonly) NSArray *employees;
-- (void)addAssistantsObject:(ModelAssistant*)value_ settingInverse: (BOOL) setInverse;
- (void)addAssistantsObject:(ModelAssistant*)value_;
- (void)removeAssistantsObjects;
-- (void)removeAssistantsObject:(ModelAssistant*)value_ settingInverse: (BOOL) setInverse;
- (void)removeAssistantsObject:(ModelAssistant*)value_;
-- (void)addDepartmentsObject:(ModelDepartment*)value_ settingInverse: (BOOL) setInverse;
- (void)addDepartmentsObject:(ModelDepartment*)value_;
- (void)removeDepartmentsObjects;
-- (void)removeDepartmentsObject:(ModelDepartment*)value_ settingInverse: (BOOL) setInverse;
- (void)removeDepartmentsObject:(ModelDepartment*)value_;
-- (void)addEmployeesObject:(ModelEmployee*)value_ settingInverse: (BOOL) setInverse;
- (void)addEmployeesObject:(ModelEmployee*)value_;
- (void)removeEmployeesObjects;
-- (void)removeEmployeesObject:(ModelEmployee*)value_ settingInverse: (BOOL) setInverse;
- (void)removeEmployeesObject:(ModelEmployee*)value_;
-
@end
Oops, something went wrong.

0 comments on commit 25b700a

Please sign in to comment.