Re: NSTreeController - setEntityName only settable once??
Re: NSTreeController - setEntityName only settable once??
- Subject: Re: NSTreeController - setEntityName only settable once??
- From: Scott Anguish <email@hidden>
- Date: Sun, 29 Jan 2006 17:56:31 -0500
I think you'd be better off creating the objects yourself and
inserting them into the controller using one of the other methods.
On Jan 29, 2006, at 4:42 PM, email@hidden wrote:
Hi List,
I'm trying to insert different objects (but have the same
superclass/entity) in an NSTreeController.
So to do this, I just add a method to the tree controller like
insert<entityName>.
So inserting a "Country" looks like so:
- (IBAction)addCountry:(id)sender
{
[self setEntityName:@"Country"];
[self insert:sender];
}
This works the first time, but other methods such as
- (IBAction)addAttribute:(id)sender
{
[self setEntityName:@"Attribute"];
[self insert:sender];
}
Fail to insert an attribute, it instead is stuck inserting a
Country entity.
Even though [self entityName] returns "Attribute" the
NSTreeController still inserts a "Country" entity!!!
It seems that at runtime, whatever is called first (Attribute or
Country), thats what it always creates, even if - entityName
returns something else....
Bug? Workaround? DTS?
Thanks in advance,
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
_______________________________________________
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