Partially SOLVED: Having trouble with NSTreeController, NSOutlineView, and Core Data

  • Hi,  just want to let you know that after getting some much-needed inspiration
    from the Core Recipes sample code, I've jury-rigged my outline view into
    working.  What it involved was selecting the data model file (*.xcdatamodel),
    and then going up to New File assistant in the File menu in Xcode.  There is an
    option there that only appears when a data model is selected, for "Managed
    Object Class." It will automatically do all the heavy lifting for you of making
    a custom managed object class; then all you have to do (at least this is what I
    did) is modify the accessors etc. to your liking.  For example, I added isLeaf
    and count methods to it because I was getting some errors about those selectors
    not being there.  So in conclusion, it seems that NSTreeController is still
    fairly broken (I'm not too educated on it, but based on what I've read on the
    blogs I'd have to agree), but there are some fairly decent ways of getting
    around its problems.  For more information on this I'd suggest (a) Wil
    Shipley's excellent treatment of the topic in his blog, and (b) the Core
    Recipes DMG.

    Sam