NSStream and NSRunModalForWindow
NSStream and NSRunModalForWindow
- Subject: NSStream and NSRunModalForWindow
- From: Peter C <email@hidden>
- Date: Tue, 24 May 2011 18:03:26 +0800
I have a window sending data via NSStream to another app. Whenever I invoke another modal window, the data stops. Somehow NSStream is block by NSRunModalForWindow. The code is pretty standard, a snippet of the code,
[NSStream getStreamsToHost:host port:portNumber
inputStream:&iStream outputStream:&oStream];
[iStream retain];
[oStream retain];
[iStream setDelegate:(id)self];
[oStream setDelegate:(id)self];
[iStream scheduleInRunLoop:[NSRunLoop currentRunLoop]
forMode:NSDefaultRunLoopMode];
[oStream scheduleInRunLoop:[NSRunLoop currentRunLoop]
forMode:NSDefaultRunLoopMode];
[iStream open];
[oStream open];
I am thinking of moving the whole NSStream code from NSWindowController to a thread but somehow I got a feeling is not correct. How does NSStream avoid blocking by other factors such as modal window ?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden