Iphone 正在线程中初始化UITextView--导致问题

Iphone 正在线程中初始化UITextView--导致问题,iphone,cocoa-touch,uitextview,nsthread,Iphone,Cocoa Touch,Uitextview,Nsthread,当我尝试在线程中执行时: UITextView *aDescriptionView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 25, 50)]; 我得到这个错误: bool _WebTryThreadLock(bool), 0x2819b0: Tried to obtain the web lock from a thread other than the main thread or the web thread. This m

当我尝试在线程中执行时:

UITextView *aDescriptionView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 25, 50)];
我得到这个错误:

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...

这里出了什么问题?我该怎么办?我必须将它放在一个单独的线程中,因为它会返回一个UIView对象。

除了主线程之外,您不能从任何线程访问UI。永远。

GUI不应该在辅助线程中完成。这是否包括访问属性,例如[myTextView text]?我认为如果您只阅读信息是安全的,但我不确定。