作者sinread (电脑真耗钱)
看板MacDev
标题Re: [问题] 从 main thread perform 其他的 thread
时间Tue Oct 5 11:09:18 2010
※ 引述《sinread (电脑真耗钱)》之铭言:
: ※ 引述《zonble (zonble)》之铭言:
: : 比较有可能的是,你直接使用 NSImage imageWithContentsOfURL:
: : 这种方法读 Image 会 block UI。建议改用 NSURLConnection
: : 来读取网路上的资料。
: 使用socket也可以用NSURLConnection ? 这部份我没有详读~
: 不过如果UI 和 stram 分开来的话, 就算用NSOperation
: 也会遇到main thread 和 other thread沟通的问题~ 不是嘛?
: 我还是对thread inner communications 不慎了解... 0rz...
感谢zonble大的"饭粒"~
我已经知道怎麽样perform另一个thread
同时也发现我的code最大的问题是在 main thread 里的UI被叫到的时候
连接server的物件的address 居然是0x0 ...
我在好好来debug!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 124.219.26.209