• 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: 'Static' items in an NSOutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'Static' items in an NSOutlineView


  • Subject: Re: 'Static' items in an NSOutlineView
  • From: Quincey Morris <email@hidden>
  • Date: Tue, 18 Oct 2011 12:21:11 -0700

On Oct 18, 2011, at 05:20 , Koen van der Drift wrote:

> when my app starts the first time, I would like to have the
> outline view be prepopulated with a few groups: LIBRARY, FAVORITES,
> RECENT and maybe Group1 (a child of LIBRARY).  I did all that, but did
> not add Group1 to be a child of LIBRARY, so I will do that too. Am I
> correct in doing this through an NSFetchRequest, for an entity
> @"Group" with a predicate @"Library"?

You'd probably be better off finding all of your "special" group objects when your app first accesses an existing persistent store, and keeping the pointers in instance or static variables. But you can fetch them on demand if you want.

> Do you mean that if I create the 'static' items in the order I want
> them to be displayed (LIBRARY - FAVORITES - RECENT), that's the order
> in which they always will be displayed?

We're talking about Core Data, right? Objects in a Core Data persistent store have no intrinsic order, though they can be indexed on one of their properties.

Unfortunately, I've forgotten (if I ever knew) how you were approaching all this. The existence of these special top-level groups, plus the complication of Core Data, means that simply binding a NSTreeController to *a* data model is too inflexible. As I said before, in situations like this, you really want an intermediate data model.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: 'Static' items in an NSOutlineView
      • From: Koen van der Drift <email@hidden>
References: 
 >'Static' items in an NSOutlineView (From: Koen van der Drift <email@hidden>)
 >Re: 'Static' items in an NSOutlineView (From: Quincey Morris <email@hidden>)
 >Re: 'Static' items in an NSOutlineView (From: Koen van der Drift <email@hidden>)
 >Re: 'Static' items in an NSOutlineView (From: Koen van der Drift <email@hidden>)
 >Re: 'Static' items in an NSOutlineView (From: Quincey Morris <email@hidden>)
 >Re: 'Static' items in an NSOutlineView (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Re: Custom NSArrayController that manages its own array?
  • Next by Date: Re: Launching 10.5 app on 10.4
  • Previous by thread: Re: 'Static' items in an NSOutlineView
  • Next by thread: Re: 'Static' items in an NSOutlineView
  • Index(es):
    • Date
    • Thread