views:

47

answers:

0

I am trying to track down a bug in the sample code provided for the WWDC Session 104 - Designing Apps with Scroll Views: "PhotoScroller"

It is a mutated while being enumerated error that only happens on occasion when paging from a zoomed image to one of the other images. I am using part of this code in one of my apps and am desperately trying to find the cause.

It can be a bit difficult to make the bug happen, but it is frequent enough that I don't want to release the app with the bug. It especially happens when the user is having trouble paging from one image (while zoomed in) to the next and has to make several attempts. It usually takes me a few minutes to make it happen.

I attached part of the gdb report and a screen shot of the debugger screen.

Has anyone else using this code found and repaired this bug? If so, can you please share the fix. Otherwise, please offer any suggestions on how to find the problem.

alt text

2010-10-25 15:20:52.194 PhotoScroller[8704:307] *** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <__NSCFSet: 0x1219f0> was mutated while being enumerated.<CFBasicHash 0x1219f0 [0x3e801d60]>{type = mutable set, count = 3,
entries =>
0 : <ImageScrollView: 0x12db00; baseClass = UIScrollView; frame = (350 0; 320 480); clipsToBounds = YES; layer = <CALayer: 0x12af70>; contentOffset: {-0, -0}>

1 : <ImageScrollView: 0x1229e0; baseClass = UIScrollView; frame = (690 0; 320 480); clipsToBounds = YES; layer = <CALayer: 0x121cb0>; contentOffset: {-0, -0}>

2 : <ImageScrollView: 0x13c760; baseClass = UIScrollView; frame = (350 0; 320 480); clipsToBounds = YES; layer = <CALayer: 0x13cf40>; contentOffset: {0, 0}>
}

I really appreciate the help. Thanks!