Re: [問題] 從 main thread perform 其他的 thread
※ 引述《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
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 10 之 10 篇):
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章