PDA

View Full Version : Generating NSManagedObject Class Automatically




teguh123
May 11, 2011, 08:12 AM
I see that Xcode properly add these methods on Business.m

- (void)addDistrictsObject:(District *)value {
NSSet *changedObjects = [[NSSet alloc] initWithObjects:&value count:1];
[self willChangeValueForKey:@"Districts" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects];
[[self primitiveValueForKey:@"Districts"] addObject:value];
[self didChangeValueForKey:@"Districts" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects];
[changedObjects release];
}

Unfortunately xcode do not add

(void)addDistrictsObject:(District *)value;

On Business.h

Why?

I got compilerwarning when I tried to use function addDistrictsObject

Also I do not want to change either Business.h or Business.m The xdatamodel will still change a lot.

So what should I do?