The weird thing here is that I had all that.
The code is below.
Address *theAddress;
ContactAddress *newObject;
EOEditingContext *theEditingContext;
theAddress = [[Address alloc] init];
[theAddress setSecondAddress:@"vgbdfgd"];
[theAddress setDelivAddress:@"gfgfjfdg"];
[theAddress setCity:@"hgafdgdgsh"];
[theAddress setZipPlus4:@"32332"];
[theAddress setAddressForeignInd:@"Y"];
[theAddress setAddressType:@"Main Business Address"];
[theAddress setState:@"MD"];
[theAddress setCountry:@"USA"];
newObject = [[ContactAddress alloc] init];
[theAddress addObject:newObject
toPropertyWithKey:@"toContactAddress"];
theEditingContext = [[self session] defaultEditingContext];
[theEditingContext insertObject:theAddress];
[theEditingContext insertObject:newObject];
[theEditingContext saveChanges];
Moreover in my eomodel The Address table has a relation to the other
table and Owns object and propogate primary keys are selected.
Guess what, when It inserts the object , both primary keys in the
destination table have been inserted as 0's.
Any idea?
thnaks a lot.
MC.
Get Your Private, Free Email at http://www.hotmail.com