am new to ios programming. my app is linking with a library that opens NSStream and uses them as below:
[inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; [outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
: and events for above streams are handled by
- (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode
in same file (or default thread?)
I need to talk to server in another context and if I use NSStreams, do I have to setup a different thread/run loop? i don't want to touch above library code. how can i have another stream handling callback?
I saw this post. Is that applicable?
NSStream and Sockets, NSStreamDelegate methods not being called
thanks