You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Use Motion streak for some time.
2. After a while the application terminates itself with an error
"Terminating app due to uncaught exception 'NSRangeException', reason: '***
-[NSCFArray objectAtIndex:]: index (-1( or possibly larger)) beyond bounds
(0)'"
What cocos2d version are you using ?
Latest
What iPhoneSDK are you using ?
2.1
Debug or Release ?
Both
Does this happen on device ? or on the simulator ? or on both ?
Both
Please provide any additional information below.
in Ribbon.m in function
-(void)addPointAt:(cpVect)location width:(float)w
this:
RibbonSegment* seg;
// first lets kill old segments
for (seg in mSegments)
{
if (seg->finished)
{
[dSegments addObject:seg];
}
}
[mSegments removeObjectsInArray:dSegments];
// grab last segment and appent to it if it's not full
seg = [mSegments objectAtIndex:[mSegments count]-1];
// is the segment full?
if (seg->end >= 50)
{
should be changed to this:
RibbonSegment* seg;
// grab last segment
seg = [mSegments objectAtIndex:[mSegments count]-1];
// lets kill old segments
for (RibbonSegment* seg2 in mSegments)
{
if (seg2 != seg && seg2->finished)
{
[dSegments addObject:seg2];
}
}
[mSegments removeObjectsInArray:dSegments];
// is the segment full?
if (seg->end >= 50)
What's wrong:
When ALL segments have finished
[mSegments removeObjectsInArray:dSegments];
will delete all segments from mSegments. And
seg = [mSegments objectAtIndex:[mSegments count]-1];
will fail because mSegments will be empty. This patch is making sure that
there is at least one segment left in mSegment.
Original issue reported on code.google.com by kermidt....@gmail.com on 28 Feb 2009 at 9:42
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
kermidt....@gmail.com
on 28 Feb 2009 at 9:42The text was updated successfully, but these errors were encountered: