ios - Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread -
i getting crash after converting existing uiviewcontroller
auto layout , can't figure out causing it. did search dispatch_async(dispatch_get_global_queue(...))
calls none changes layout.
the stack trace unhelpful:
* thread #18: tid = 0x73617, 0x0000000183aa8524 libobjc.a.dylib`objc_exception_throw, stop reason = breakpoint 3.1 * frame #0: 0x0000000183aa8524 libobjc.a.dylib`objc_exception_throw frame #1: 0x0000000185071100 corefoundation`+[nsexception raise:format:] + 116 frame #2: 0x0000000185c83894 foundation`_assertautolayoutonallowedthreadsonly + 192 frame #3: 0x0000000185c835d4 foundation`-[nsisengine _optimizewithoutrebuilding] + 76 frame #4: 0x0000000185aceddc foundation`-[nsisengine optimize] + 112 frame #5: 0x0000000185c82270 foundation`-[nsisengine performpendingchangenotifications] + 112 frame #6: 0x000000018af23e18 uikit`-[uiview(hierarchy) layoutsubviews] + 220 frame #7: 0x000000018b15fff8 uikit`-[uislider layoutsubviews] + 192 frame #8: 0x000000018af23a80 uikit`-[uiview(calayerdelegate) layoutsublayersoflayer:] + 1196 frame #9: 0x00000001883d19d8 quartzcore`-[calayer layoutsublayers] + 148 frame #10: 0x00000001883c64cc quartzcore`ca::layer::layout_if_needed(ca::transaction*) + 292 frame #11: 0x00000001883c638c quartzcore`ca::layer::layout_and_display_if_needed(ca::transaction*) + 32 frame #12: 0x00000001883433e0 quartzcore`ca::context::commit_transaction(ca::transaction*) + 252 frame #13: 0x000000018836aa68 quartzcore`ca::transaction::commit() + 512 frame #14: 0x000000018836af34 quartzcore`ca::transaction::release_thread(void*) + 660 frame #15: 0x0000000184103fbc libsystem_pthread.dylib`_pthread_tsd_cleanup + 572 frame #16: 0x0000000184103ce4 libsystem_pthread.dylib`_pthread_exit + 200 frame #17: 0x0000000184103378 libsystem_pthread.dylib`_pthread_wqthread + 1504 frame #18: 0x0000000184102d8c libsystem_pthread.dylib`start_wqthread + 4 (lldb)
is there way figure out exact place triggered layout?
i found out problem after taking @ stack trace. problem was changing value
property of uislider
instance on background thread.
but state have change on main thread! (thanks, apple) apparently, seems uislider
implements value
's setter , forces layout or similar.
Comments
Post a Comment