【发布时间】:2012-04-25 05:46:39
【问题描述】:
我有一个自定义表格视图单元格,其中包含一些对象 UIImageView、UILabel 和一个 UITextView。除了 UITextView 之外的所有对象都可以正常工作,但是当我尝试更改 textView 上的文本时:
myTextView.text = @"Some string";
应用程序因此错误而崩溃:
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...
非常感谢任何建议。 谢谢
【问题讨论】:
-
您似乎正在尝试从辅助线程更新文本,是这样吗?你能再添加一些代码吗?
-
使用 performSelectorOnMainThread(NSObject 方法)来更新你的 UITextView
标签: iphone objective-c xcode