iphone - Enumeration Mutation During UIView transitionWithView -


i'm experience occasional crash of iphone application i'm getting following exception

nsgenericexception', reason: '*** collection <calayerarray: 0x26f6b0> mutated while being enumerated. 

with stack trace on crashing thread of

thread 0 crashed: 0   libsystem.b.dylib                   0x00078ac8 __kill + 8 1   libsystem.b.dylib                   0x00078ab8 kill + 4 2   libsystem.b.dylib                   0x00078aaa raise + 10 3   libsystem.b.dylib                   0x0008d03a abort + 50 4   libstdc++.6.dylib                   0x00044a20 __gnu_cxx::__verbose_terminate_handler() + 376 5   libobjc.a.dylib                     0x00005958 _objc_terminate + 104 6   libstdc++.6.dylib                   0x00042df2 __cxxabiv1::__terminate(void (*)()) + 46 7   libstdc++.6.dylib                   0x00042e46 std::terminate() + 10 8   libstdc++.6.dylib                   0x00042f16 __cxa_throw + 78 9   libobjc.a.dylib                     0x00004838 objc_exception_throw + 64 10  corefoundation                      0x0009f850 __nsfastenumerationmutationhandler + 208 11  libobjc.a.dylib                     0x0000a51a objc_enumerationmutation + 18 12  uikit                               0x00007bfe -[uiview(hierarchy) _makesubtreeperformselector:withobject:withobject:copysublayers:] + 142 13  uikit                               0x00007c2e -[uiview(hierarchy) _makesubtreeperformselector:withobject:withobject:copysublayers:] + 190 14  uikit                               0x00007cd2 -[uiview(hierarchy) _makesubtreeperformselector:withobject:] + 22 15  uikit                               0x00007628 -[uiview(internal) _addsubview:positioned:relativeto:] + 304 16  uikit                               0x000074e8 -[uiview(hierarchy) addsubview:] + 16 17  uikit                               0x0006c350 +[uiviewcontrollerwrapperview wrapperviewforview:frame:] + 232 18  uikit                               0x00077d0c -[uinavigationcontroller _starttransition:fromviewcontroller:toviewcontroller:] + 468 19  uikit                               0x00077abc -[uinavigationcontroller _startdeferredtransitionifneeded] + 176 20  uikit                               0x00077a00 -[uinavigationcontroller viewwilllayoutsubviews] + 8 21  uikit                               0x0006dca8 -[uilayoutcontainerview layoutsubviews] + 132 22  uikit                               0x0000fbc0 -[uiview(calayerdelegate) _layoutsublayersoflayer:] + 20 23  corefoundation                      0x0003e2e4 -[nsobject(nsobject) performselector:withobject:] + 16 24  quartzcore                          0x0000f942 -[calayer layoutsublayers] + 114 25  quartzcore                          0x0000f6fa calayerlayoutifneeded + 178 26  quartzcore                          0x000094c4 ca::context::commit_transaction(ca::transaction*) + 204 27  quartzcore                          0x000092da ca::transaction::commit() + 186 28  quartzcore                          0x0002d9b6 ca::transaction::observer_callback(__cfrunloopobserver*, unsigned long, void*) + 46 29  corefoundation                      0x00030236 __cfrunloop_is_calling_out_to_an_observer_callback_function__ + 10 30  corefoundation                      0x000300aa __cfrunloopdoobservers + 406 31  corefoundation                      0x000276b4 __cfrunlooprun + 848 32  corefoundation                      0x00027270 cfrunlooprunspecific + 224 33  corefoundation                      0x00027178 cfrunloopruninmode + 52 34  graphicsservices                    0x000045ec gseventrunmodal + 108 35  graphicsservices                    0x00004698 gseventrun + 56 36  uikit                               0x0000411c -[uiapplication _run] + 396 37  uikit                               0x00002128 uiapplicationmain + 664 38  idrivegreen                         0x00003026 main (main.m:13) 39  idrivegreen                         0x00002ff0 start + 32 

this crash being triggered after following code executed.

stoprouteviewcontroller *stopvc = [[stoprouteviewcontroller alloc] init];    [uiview transitionwithview:self.navigationcontroller.view                   duration:0.5                    options:uiviewanimationoptiontransitionflipfromleft                 animations:^{                     [self.navigationcontroller pushviewcontroller:stopvc animated:no];                 }                 completion:null]; [stopvc release]; 

does blatantly wrong anyone? current thought is either tied stopvc being released before pushed or transitioning navigationcontroller.view while @ same time pushing new viewcontroller navigationcontroller.

since occurs occasionally, i'd have little more confidence before commit potential fix.

yes, incorrect usage of api. -[uinavigationcontroller pushviewcontroller:animated:] handles animation on own. if pass no second argument, still manipulating view hierarchy, what's causing crash.

basically, there no reason put call -[uinavigationcontroller pushviewcontroller:animated:] in animation block, have done. if want animate push of controller, pass yes second argument.


Comments

Popular posts from this blog

400 Bad Request on Apache/PHP AddHandler wrapper -

Add email recipient to all new Trac tickets -

php - Change action and image src url's with jQuery -