作者issuemylove (NotLove)
看板MacDev
标题[问题] 如何控制EASession的读取、写出
时间Thu Jul 30 11:36:37 2015
各位好,我依照官方网站EASession的相关guide
https://goo.gl/WhKze5
在 EASession 的 NSStreamDelegate的部分
上方网页最下方的函式
- (void)stream:(NSStream*)theStream handleEvent:(NSStreamEvent)streamEvent
里面分别有读取、写出的判断式
可是我要如何“主动”将我要给Accessory的资讯写出(NSOutputStream write)
因为写在上方函式的话 (那是delegate内)所以无法主动write
还是说 NSStreamEventHasSpaceAvailable 的 event
是於accessory可以被写入的时候便会呼叫到呢?
抱歉对这部分的观念不是很懂,谢谢指教!
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 59.113.208.136
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MacDev/M.1438227400.A.828.html