NSTreeController - setEntityName only settable once??
NSTreeController - setEntityName only settable once??
- Subject: NSTreeController - setEntityName only settable once??
- From: email@hidden
- Date: Sun, 29 Jan 2006 13:42:26 -0800
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