[TIMOB-13333] iOS: setting view property cause "Collection <CALayerArray: 0x645dfc0> was mutated while being enumerated.”
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | layer, proxy, thread, view |
Reporter | Martin Guillon |
Assignee | Unknown |
Created | 2012-10-24T09:08:32.000+0000 |
Updated | 2018-02-28T20:04:22.000+0000 |
Description
My app is doing pretty fast animations. Especially depending on user interaction, views can be very quickly animated, modified (visibility, opacity).
Recently i have been facing a lot of crash:
Collection <CALayerArray: 0x645dfc0> was mutated while being enumerated.
I have been trying to to the depth of that bug. This what i have found.
I post as an image the callstack in xcode.
What i can say is that the bug is appearing when processing a
view.visible = true
in my script.
What i think is happening is that we try to change the hidden property of a layer while modifying the layers stack (insertSubview in TiViewProxy).
I have also been looking on the web for this one and i have found a post related to that
http://stackoverflow.com/questions/1711700/iphone-ui-addsubview-causing-concurrency-exception
I have been trying to create a simple example of this without success. And i cant post the code of my app.
Will still try to find a test case.
Yet i think we already have enough information to understand that bug, and so start working onit.
Attachments
File | Date | Size |
---|---|---|
Screen Shot 2012-10-24 at 11.03.39 AM.png | 2012-10-24T09:08:32.000+0000 | 90790 |
So i keep on working on this one. This is what i have now. What is happening is that [TiUIView::setVisible_](https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiUIView.m#L561) is called while that view in is parent in [TiViewProxy::insertSubview](https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiViewProxy.m#L2121) I have tried using @synchronized without success. I need help on this.
Martin, can you please confirm this also happens on 3.0.0?
i can confirm it WASN'T happening in 3.0.0, at least at githash 484f237
Try setting opacity to 0 instead and see if that solves the issue for now.
Actually i think i fixed this in my branch. Will have to look through the code to find the solution :s EDIT: also i cant use opacity = 0. i actually use a combination of opacity and visibility. They dont have the same meaning