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


  • Prev by Date: Re: Strange resizing issue with NSView
  • Next by Date: Re: [SOLVED] title bars messed up when scrolling in NSTableView
  • Previous by thread: Re: NSTreeController - setEntityName only settable once??
  • Next by thread: Re: NSTreeController - setEntityName only settable once??
  • Index(es):
    • Date
    • Thread