2

When I am trying to execute in a thread:

UITextView *aDescriptionView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 25, 50)];

I am getting this error:

bool _WebTryThreadLock(bool), 0x2819b0: 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...

What went wrong here? What should I do? I have to have this in a separate thread as it returns me a UIView object.

Abhinav
  • 37,684
  • 43
  • 191
  • 309

1 Answers1

5

You must not access UI from any thread besides the main thread. Ever.

seppo0010
  • 15,184
  • 5
  • 31
  • 30