I'm getting the following error:
201开发者_开发百科0-05-11 17:46:28.475 MyApp[54112:5e1b] bool _WebTryThreadLock(bool), 0x140faa0: 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...
Is there any way for me to figure out where [54112:5e1b] is in my code, so I can try to narrow down the error?
Thanks.
You may be able to narrow down the error simply by making sure you don't do anything to UIKit objects in a secondary thread, it's what the error message seems to be accusing you of. Background threads are for background tasks - you can do anything you like but when your background thread needs to have an effect on your view (as in model, view, controller) you need to do something to communicate with your main thread and cause it to do the change - like performSelectorOnMainThread
.
But Mac OS X Debugging Magic is a very popular and useful document that could help find exactly what is at that address.
精彩评论