• 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
Re: Event loop: getting access once per loop?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Event loop: getting access once per loop?


  • Subject: Re: Event loop: getting access once per loop?
  • From: "Erik M. Buck" <email@hidden>
  • Date: Wed, 29 Jan 2003 10:29:53 -0500

There is the NSApplication delegate method, - (void)applicationWillUpdate:.

- (void)applicationWillUpdate:(NSNotification *)aNotification

Sent by the default notification center immediately before the NSApplication
object updates its NSWindows. aNotification is always an
NSApplicationWillUpdateNotification. You can retrieve the NSApplication
object in question by sending object to aNotification.
See Also: - applicationDidUpdate:, - updateWindows


There is -performSelector:withObject:afterDelay:

- (void)performSelector:(SEL)aSelector withObject:(id)anArgument
afterDelay:(NSTimeInterval)delay

Sends an aSelector message to the receiver sometime after delay. This method
returns before the aSelector message is sent. The aSelector method should
not have a significant return value and should take a single argument of
type id, or no arguments; anArgument will be the argument passed in the
message, or nil if the method does not take any arguments. Note that self
and anArgument are retained until after the message is sent. See "Selectors"
for a description of the SEL type.
See Also: + cancelPreviousPerformRequestsWithTarget:selector:object:, , , -
performSelectorOnMainThread:withObject:waitUntilDone:, , , -
performSelectorOnMainThread:withObject:waitUntilDone:modes:



However, be warned that the Cocoa event loop does not execute when there are
no events or other I/O pending. The entire application is blocked and not
using CPU. Trying to add idle processing to a Cocoa event loop is pointless.
You will need a timer or -performSelector:withObject:afterDelay: which uses
a timer to do something similar to idle processing.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Custom Drawing?
  • Next by Date: Re: formatter user input
  • Previous by thread: Re: Event loop: getting access once per loop?
  • Next by thread: Delaying button redraws?
  • Index(es):
    • Date
    • Thread