xcode - How to configure NSTreeController in Interface Builder -


when select nstreecontroller in interface builder (in xcode 4.6.3) , @ attributes inspector, see 2 sections named tree controller , object controller. tree controller part makes sense, i'm having trouble finding explanation of object controller section. first item "mode", options "class" , "entity name", , think use latter when using core data , former when not. i'm not using core data. so, what's meaning of next item, class name? defaults nsmutabledictionary, thought standard tree node type nstreenode. specifically, if want tree node nstreenode represented object nsmutabledictionary, how fill in object controller section?


post-answer afterthought: although see 1 can use nodes of type nsmutabledictionary build content tree outline view, there advantages making subclass of nstreenode. first, nstreenode automatically keeps track of parent links, can useful in cases. second, can define data members properties, , access them using dot notation rather objectforkey: messages.

the object controller panel interface builder's way of allowing set either entityname property of nstreecontoller or objectclass property. (nstreecontroller subclass of nsobjectcontroller, these properties defined.)

nstreenode class used cocoa wrap objects (or entities) before they're placed in tree. have no in process, happens automatically , nothing attributes inspector. what's more you'll (never?) need create nstreenode instance - though interact them pretty regularly.

so looks don't need in panel - default values you're after. of course, you'll still need fill in key paths section.

here's simple demo project (created xcode 6.3). help.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -