The best way to handle this would be in the Foo class' accessor methods for the Bar relationship If the relationship is Foo. Bars the Foo class will have accessors that look like: addBarsObject: removeBarsObect: addBarsObjects: removeBarsObjects: that will look like: (void)addBarsObject:(NSManagedObject *)value { NSSet *changedObjects = NSSet alloc initWithObjects:&value count:1; self willChangeValueForKey:@"bars" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects; self primitiveValueForKey:@"bars" addObject:value; self didChangeValueForKey:@"bars" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects; changedObjects release; } and you just need to modify it like so: (void)addBarsObject:(NSManagedObject *)value { NSSet *changedObjects = NSSet alloc initWithObjects:&value count:1; self willChangeValueForKey:@"bars" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects; self primitiveValueForKey:@"bars" addObject:value; self didChangeValueForKey:@"bars" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects; changedObjects release; self. BarCount = NSNumber numberWithFloat:(self.
BarCount intValue + 1); //... or self. BarCount=self. Bars count; } Change all the Foo.
Bars accessor methods to track the change in the relationship as you go. This has the added advantage of keeping track of the count between saves which you probably actually need.
The best way to handle this would be in the Foo class' accessor methods for the Bar relationship. If the relationship is Foo. Bars, the Foo class will have accessors that look like: addBarsObject: removeBarsObect: addBarsObjects: removeBarsObjects: ... that will look like: - (void)addBarsObject:(NSManagedObject *)value { NSSet *changedObjects = NSSet alloc initWithObjects:&value count:1; self willChangeValueForKey:@"bars" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects; self primitiveValueForKey:@"bars" addObject:value; self didChangeValueForKey:@"bars" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects; changedObjects release; } ... and you just need to modify it like so: - (void)addBarsObject:(NSManagedObject *)value { NSSet *changedObjects = NSSet alloc initWithObjects:&value count:1; self willChangeValueForKey:@"bars" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects; self primitiveValueForKey:@"bars" addObject:value; self didChangeValueForKey:@"bars" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects; changedObjects release; self.
BarCount = NSNumber numberWithFloat:(self. BarCount intValue + 1); //... or self. BarCount=self.
Bars count; } Change all the Foo. Bars accessor methods to track the change in the relationship as you go. This has the added advantage of keeping track of the count between saves which you probably actually need.
I think you can do this before you call NSManagedObjectContext's (BOOL)save:(NSError **)error. You can create a method where all calls related to the NSManagedObject's assignment converge & totalAssigments is updated before calling save. HTH, Akshay.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.