作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我尝试在线程中执行时:
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。曾经。
关于iphone - 在线程中初始化 UITextView ——导致问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4834537/
我是一名优秀的程序员,十分优秀!