来自工作线程的"PostMessage"将消息发送到主GUI线程
问题描述:
....
我已经创建了一个线程,现在我想从该线程向主GUI线程发送消息(以执行特定事件),以便该GUI线程可以执行我的消息.任何人都可以告诉我如何在iphone中执行此操作(目标C)
....
I have created a thread and now i want to send message(to do a particular event) from the thread to the main GUI thread, so that th GUI thread can execute my message.can any one tell me how to do this in iphone(Objective C)
答
如果您使用的是Cocoa
,请查看 [
If you are using Cocoa
then have a look at "Safe, threaded design and inter-thread communication"[^].