0

Bug info as following: bool _WebTryThreadLock(bool), 0xf28fbd0: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...

1   _ZL17_WebTryThreadLockb

2   WebThreadLock

3   -[UIWebTiledView layoutSubviews]

4   -[UIWebDocumentView layoutSubviews]

5   -[UIView(CALayerDelegate) layoutSublayersOfLayer:]

6   -[NSObject performSelector:withObject:]

7   -[CALayer layoutSublayers]

8   CA::Layer::layout_if_needed(CA::Transaction*)

9   CA::Context::commit_transaction(CA::Transaction*)

10  CA::Transaction::commit()

11  CA::Transaction::pop()

12  +[CATransaction commit]

13  FigLayerSynchronizerSynchronizeToMoment

14  itemremote_TimebaseSynchronizationUpdate

15  FigPlayerRemoteCallbacksServer_TimebaseSynchronizationUpdate

16  _XTimebaseSynchronizationUpdate

17  figmoviecallbacks_server

18  fpr_ClientPortCallBack

19  FigExpressNotificationThread

20  figThreadMain

21  _pthread_start

22  thread_start

I know it was caused by updating UI in the thread other than the main thread.But I don't know why it was updated not in the main thread

Following is the description: It was just similiar to the application BaoFengYingYin. It supported autoplay,minimize playing UI,close Playing UI. When I clicked one picture in picWall,it jumped to a uiviewcontroller A ,and played audio file,show the audio file content and update the progress of progressview.

A was composed by a custom view and a movieplaycontroller variable.

The custom UIView was composed by textview(which show the audio file content),progressView , picture,minimize button ,close button.

As it should continue playing the current audio when I clicked the minimize button ,and when the audio was playing ,I should update the progress of the progressbar in my custom UIView,so I defined the movieplaycontroller variable and custom view as global variable.

The movieplaycontroller variable was initialized in the appdelegate file,But the custom view was initialized in A.

When I clicked minimized button and closed button,I will disappear A,and release the custom view at the same time.

The above is my function need and my implementation. When it enter *A,I didn't created new thread,so I thought the custom view would not be updated by a thread not in the main.But it would crash when I repeatedly clicked different audio to play.It always happened when I repeated several times and not disciplinarian. It would happen on the iPhone4,I did not see it happen on iPhone4s,iphone 5.I had not iPhone 3gs,so I didnot know if it would happened too.*

Now I modify my code to add the custom view by the function  ”performSelectorOnMainThread“ in A's init function.It seemed solved.

I published this question,beacuse I want know the reason caused my custom view updating from a thread other than the main thread. If someone know,please tell me!Thanks

2
  • Add exception breakpoint to your project catch the place where exception is arising and add that code to your question so that we could identify the problem. Mar 14, 2013 at 5:52
  • I‘ll try it again.sometimes I set breakpoints,but there was only system kernel crash info
    – gsy
    Mar 18, 2013 at 5:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.