• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSStream and NSRunModalForWindow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSStream and NSRunModalForWindow
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: encoding of file names
  • Next by Date: Re: NSStream and NSRunModalForWindow
  • Previous by thread: Re: encoding of file names
  • Next by thread: Re: NSStream and NSRunModalForWindow
  • Index(es):
    • Date
    • Thread