• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTreeController - setEntityName only settable once??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: NSTreeController - setEntityName only settable once??
      • From: Andre <email@hidden>
References: 
 >NSTreeController - setEntityName only settable once?? (From: email@hidden)

  • Prev by Date: Re: Are there any NSUserDefaults keys which aren't valid?
  • Next by Date: Re: NSAutoreleasePool Problem
  • Previous by thread: NSTreeController - setEntityName only settable once??
  • Next by thread: Re: NSTreeController - setEntityName only settable once??
  • Index(es):
    • Date
    • Thread