Re: Application halts when using popup or app menu?
Re: Application halts when using popup or app menu?
- Subject: Re: Application halts when using popup or app menu?
- From: "Stephen F. Booth" <email@hidden>
- Date: Sun, 17 Jun 2007 14:03:40 -0700
I have an application that receives data over a TCP/IP network
between 2 and
5 times per second. Communication is done using NSStreams.
When I enter the application menu, or a popup menu in the
interface, the
network stream is no longer monitored (datafeed shuts down). It
appears that
the application does not follow the normal run loop in which the
streams are
handled.
Obviously, I want the network to be monitored continuously, at all
times.
Is there a way to keep it going also when using menus?
Menus are run in the NSEventTrackingRunLoopMode- if you want the
connection to be monitored most of the time, use
scheduleInRunLoop:forMode: to add the stream to NSDefaultRunLoopMode,
NSModalPanelRunLoopMode, and NSEventTrackingRunLoopMode. I say
"most" because there could always be custom run loop modes that you
aren't aware of.
Stephen
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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