• 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
Bug with NSTreeController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug with NSTreeController


  • Subject: Bug with NSTreeController
  • From: Alexander Hartner <email@hidden>
  • Date: Sun, 12 Mar 2006 00:25:43 +0000

I starting getting crashes with NSTreeController. My application started crashing constently with *** -[NSCFArray objectAtIndex:]: index (x) beyond bounds (x). After some searching I came across the following link

http://www.cocoadev.com/index.pl?search=NSTreeControllerBug

What you have to do is to use a subclass of NSTreeController and overwrite the setContent methods as follows.

- (void)setContent:(id)content
{
	if(![content isEqual:[self content]])
	{
		NSArray *paths = [[self selectionIndexPaths] retain];
		[super setContent:nil];
		[super setContent:content];
		[self setSelectionIndexPaths:paths];
		[paths release];
	}
}

The site seems to suggest that this bug was isolated to 10.4.3, but I am using 10.4.5 and was experiencing the same problem. I was wondering if this is an actual bug, or if I am doing something wrong. I tried my best to debug this further, without much success. After I implemented the suggested solution, the application did not crash anymore.

Thanks for any feedback.

Alexander Hartner
email@hidden


_______________________________________________ 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: Re: Code to Run on Application Load
  • Next by Date: Re: NSLog(@"%@",[NSProxy class]);
  • Previous by thread: Re: Code to Run on Application Load
  • Next by thread: Re: Bug with NSTreeController
  • Index(es):
    • Date
    • Thread