Re: Spinning beach ball of death
Re: Spinning beach ball of death
- Subject: Re: Spinning beach ball of death
- From: Jake McArthur <email@hidden>
- Date: Sat, 22 May 2004 23:50:55 -0500
Why are you incrementing usedCount twice? These two lines do the exact
same thing:
usedCount = usedCount + 1;
usedCount += 1;
That may be the cause of your problem. You are probably losing the true
count of the number of objects in your array.
On May 22, 2004, at 11:19 PM, Ken Tozier wrote:
I wrote a custom array class (sort of a fusion between NSArray and
NSMutableArray with a few other bells and whistles thrown in) and have
run up against a really weird error when using the class inside a
method that displays a window.
I've isolated the problem to one line of code that does nothing more
than increment an integer. When I comment out the increment line, no
beachball of death. Uncommented, after a few seconds of the window
being on the screen, the beach ball appears and that's all she wrote.
Anyone have any ideas why incrementing an integer would bring
everything to a screeching halt?
Here's the relevant method
// in the @interface file, usedCount is declared like so:
int usedCount;
- (void) addObject:(id) inObject
{
[self grow: 1];
*(objRefs + usedCount) = [inObject retain];
usedCount = usedCount + 1;
// if I uncomment the next line, beachball of death
//usedCount += 1;
}
Thanks,
Ken
_______________________________________________
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.
_______________________________________________
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.