Re: NSTreeController - setEntityName only settable once??
Re: NSTreeController - setEntityName only settable once??
- Subject: Re: NSTreeController - setEntityName only settable once??
- From: email@hidden
- Date: Mon, 30 Jan 2006 17:41:54 -0800
mmalcolm crawford wrote:
On Jan 29, 2006, at 4:12 PM, Andre wrote:
- (IBAction)addAttribute:(id)sender
{
id newAttribute = [[self managedObjectContext]
insertNewEntityWithName:@"Attribute"];
[self insertObject:newAttribute atArrangedObjectIndexPath:[self
selectionIndexPath]];
}
This just adds peers...
That's because you're telling it to add a peer.
The only problem now, is, how to add children....
<http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSTreeController.html#//
apple_ref/occ/instm/NSTreeController/addChild:>
Right, but add child doesn't work when using - setEntityName multiple
times unfortunately.
Or if you need something more sophisticated, follow the pattern
Scott suggested and implement your desired behaviour in code
(create a new instance of the necessary entity and add it to the
appropriate relationship of the currently-selected object).
Thanks, I did add my own behavior in the way you and Scott just
described. It works 'well' enough.
In the mean time I have filed an enhancement request.
Thanks.
Andre
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Andre
email@hidden
Andre
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden