• 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: mmalcolm crawford <email@hidden>
  • Date: Mon, 30 Jan 2006 01:38:48 -0800


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:>


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).

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


References: 
 >NSTreeController - setEntityName only settable once?? (From: email@hidden)
 >Re: NSTreeController - setEntityName only settable once?? (From: Scott Anguish <email@hidden>)
 >Re: NSTreeController - setEntityName only settable once?? (From: Andre <email@hidden>)

  • Prev by Date: Re: Core Data: updating a key dependent on a to-many relationship?
  • Next by Date: Re: KVC broken in 10.4.4 on Intel?
  • Previous by thread: Re: NSTreeController - setEntityName only settable once??
  • Next by thread: Re: NSTreeController - setEntityName only settable once??
  • Index(es):
    • Date
    • Thread