• 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
Finding the parent of an outline view item
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Finding the parent of an outline view item


  • Subject: Finding the parent of an outline view item
  • From: Joseph Jones <email@hidden>
  • Date: Fri, 10 Jan 2003 20:59:55 -0800

Hi,

I was wondering if there was a way to find the parent of an outline view item using outline view itself? Normally, I would just use the datasource for the view, but I have an issue where my child elements are children of more than one parent. This leads to an issue where, when the view is requesting data from a child and that data is dependent on which parent this particular item is for, I have no idea how to calculate it.

I have a little hack where I walk from the current item's row back till I find the parent item (using isKindOfClass, though levelForRow is just as good here). This hack works, but I hate having to do it every time I get requests for the data. It seems to me that parent-child relationships are something that outline view would need to track, but I could be wrong on that account.

Any help would be appreciated.

TIA,
Joe
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Finding the parent of an outline view item
      • From: Mike Ferris <email@hidden>
  • Prev by Date: help with NSCopying
  • Next by Date: Problem with NSOpenPanel's runModalForDirectory:file:types: method
  • Previous by thread: Re: help with NSCopying
  • Next by thread: Re: Finding the parent of an outline view item
  • Index(es):
    • Date
    • Thread