• 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
Crazy NSTreeController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Crazy NSTreeController


  • Subject: Crazy NSTreeController
  • From: Pechoultres Xavier <email@hidden>
  • Date: Fri, 2 Jun 2006 14:39:52 +0200

Hi all,

	the NSTreeController make me crazy !

A/ First problem :
When use 2 NSTreeController and bind the content array of the second to the first by a key like : "selection.self.maindatas". The Second NSTreeController crash after some selection change in the first !!
- First solution (evocated in some post here) is to set a "Count Key Path", but after that, some usefull messages not works anymore (like add: addChild: ...). And its difficult to deal with the NStreeController and the NSOutlineView to provide a useable interface.
- Second solution : I create a small controller ou bind to the selection of the first NSTreeController, and set manually the content of the second :


[secondTreeController setContent:nil];
NSManagedObject* obj = [firstTreeController valueForKeyPath:@"selection.self"];
[secondTreeController setContent:[obj valueForKey:@"maindatas"]];


And It works !!! the binding code of the NSTreeController/content seems very bogus !

B/ Second problem :

My Second NSTreeController use the "children" key. When I use the "add:" action, I don't understand how to deal with the new inserted object to setup some properties which are contextual. The NSTreeController have no delegate like "didAddObject:(id)newObject", so I've tried to subclass it and redefine the newObject: message. First, I need to change the setting of my NSTreeController from entity based to class based. The newObject message is well called, but now i've got an error message like :

*** NSRunLoop ignoring exception 'NSManagedObjects of entity 'Data' do not support -mutableArrayValueForKey: for the property 'children'' that raised during posting of delayed perform with target 3eaba0 and selector 'invokeWithTarget:'

So It works with entity mode, but not in Class mode. In entity mode I've no control of the new object, but in Class mode it cannot deal with the weel known "children" key which is a CoreDate relationship.

Help !!


Xavier _______________________________________________ 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: Problem with subview creation or it in somewhere else
  • Next by Date: Re: Newbie error
  • Previous by thread: Re: Problem with subview creation or it in somewhere else
  • Next by thread: why doesn't my scrollview scroll ...
  • Index(es):
    • Date
    • Thread