Re: Core data. Programmatically setting relationships

2008-06-02 Thread Steven Hamilton
Apologies for being vague, I really should learn to proof read properly before pressing send. I've sussed it out. I point the relationship attribute (wrong word I know) at the instance of the new object. On 02/06/2008, at 12:48 AM, mmalc crawford wrote: On Jun 1, 2008, at 1:28 AM, Steve

Re: Core data. Programmatically setting relationships

2008-06-01 Thread mmalc crawford
On Jun 1, 2008, at 1:28 AM, Steven Hamilton wrote: What I can't do is set change the relationships. In my tableView I'm displaying the Account name in the toAccount and fromAccount columns. I want to be able to type a new Account.name in there and have the Transaction object update the rel

Re: Core data. Programmatically setting relationships

2008-06-01 Thread Steven Hamilton
Oh no, replying to my own mail! Fairly certain I have to do a fetch for the Account object with that name. So something like; - (void)tableView:(NSTableView *)tableView setObjectValue:(id)newValue forTableColumn:(NSTableColumn *)tableColumn row:(int)row { [[transactions objectAtIndex:row]

Core data. Programmatically setting relationships

2008-06-01 Thread Steven Hamilton
Hi folks, Back again with more Core Data puzzles. I have entities like so; Account; NSStringname relationshipcredit relationshipdebit Transaction; NSStringname NSDate date relationshiptoAccount (reverse of credit in Account entity) relationshipfrom