• 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's levelForItem providing odd results
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSOutlineView's levelForItem providing odd results


  • Subject: NSOutlineView's levelForItem providing odd results
  • From: Andrew Mellinger <email@hidden>
  • Date: Thu, 13 Nov 2003 18:44:46 -0800

Y'all,

I am working with an NSOutlineView and I wanted I put the following code in one of my data sources:

- (BOOL)outlineView:(NSOutlineView *)anOutlineView isItemExpandable:(id)item
{
if ([anOutlineView levelForItem:item] == 0)
{
return YES;
}

return NO;
}

My problem is that on the first item in my view (at level zero) the level returned is -1. The item value is *not* nil. The documentation indicates that -1 will be returned when item is nil.

Under my first item I have two children. When they are asked if they are Expandable, the first item passed to me also returns -1, and the second is zero. Also, on both occaisons, the item is not nil. Here is what I am being told by the levelForItem call...

- Item (-1)
- SubItem (-1)
- SubItem (0)

BTW: I made the above sample code use '== -1' so that I could see the second level.

Does anyone understand why levelForItem is giving such funky results?

Thanks,
-Andrew
_______________________________________________
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: NSOutlineView's levelForItem providing odd results
      • From: Andrew Mellinger <email@hidden>
  • Prev by Date: Re: Two dimensional array
  • Next by Date: NSSearchField
  • Previous by thread: Re: "Warp" effect?
  • Next by thread: Re: NSOutlineView's levelForItem providing odd results
  • Index(es):
    • Date
    • Thread