• 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
Re: Spinning beach ball of death
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Spinning beach ball of death (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: Variable argument lists
  • Next by Date: Re: Spinning beach ball of death
  • Previous by thread: Spinning beach ball of death
  • Next by thread: Re: Spinning beach ball of death
  • Index(es):
    • Date
    • Thread