On Jul 18, 2014, at 3:12 PM, Ken Thomases <k...@codeweavers.com> wrote:
> Setting aside the NSOutlineView bug you're describing, there are issues with > your code: > > On Jul 18, 2014, at 1:19 PM, Bill Cheeseman <wjcheese...@gmail.com> wrote: > >> - (IBAction)expandAllRows:(id)sender { >> AWRSourceListOutlineView *outlineView = [self sourceListOutlineView]; >> NSIndexSet *topLevelItemIndexes = [NSIndexSet >> indexSetWithIndexesInRange:NSMakeRange(0, [[self sourceListContents] count] >> - 1)]; > > This leaves out the index of the last item. A range consists of a starting > index and a length, _not_ the last index. Count - 1 would be appropriate for > a last index, but not for a length of a range that encompasses the last index > (assuming starting at 0). It was a lapse of attention on my part. I wrote it the right way the first time. Then, while working on another aspect of it, I glanced at this and had a flash that I needed to adjust by 1 because count is 1 more than the last index. You're right of course that NSMakeRange does want the count in the length parameter. Thanks for the catch. I'll respond to your other suggestion shortly. -- Bill Cheeseman - b...@cheeseman.name _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com