• 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
NSOutlineView collapse and expand
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSOutlineView collapse and expand


  • Subject: NSOutlineView collapse and expand
  • From: Andrew Merenbach <email@hidden>
  • Date: Wed, 24 Nov 2004 16:50:43 -0800

Perhaps I don't quite have the right terms, but I was unable to find anything in the archives about this.

I have an outline view that displays items, some of which may be identical in content, but not memory space. -[NSOutlineView reloadData] works when I add an item, but if my action immediately _prior_ to adding the item was to expand an item that (appears) identical to the new one, the new one is expanded, too. I suspect that NSOutlineView must use indexOfObject: instead of indexOfObjectIdenticalTo:, or something analogous to that, for caching of item expansion.

My items are NSDictionaries that each have two items: a dictionary of attributes, and an array of children. By adding [NSNumber numberWithLong:random()] to an arbitrary key--say @"uniqueID"--in the attributes dictionary, I have averted the problems above, but it seems like a kludge.

Is there something specific that I might elegantly override to make this work? (or perhaps a method that I missed in the docs...?)

Or, if it'd be really a kludge to override outline view methods, what about a way to make my collection objects unique, such as providing a Unique ID key? What's the best way to do that?

Cheers,
	Andrew Merenbach

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: Performance with keyed archives
  • Next by Date: NSDocument notification
  • Previous by thread: Re: Performance with keyed archives
  • Next by thread: NSDocument notification
  • Index(es):
    • Date
    • Thread