• 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: How do I open an NSDrawer in awakeFromNib?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I open an NSDrawer in awakeFromNib?


  • Subject: Re: How do I open an NSDrawer in awakeFromNib?
  • From: Markus Hitter <email@hidden>
  • Date: Wed, 13 Feb 2002 19:52:12 +0100

Am Mittwoch den, 13. Februar 2002, um 15:31, schrieb Thilo Ettelt:

What exactly does the "performSelector" of "-performSelector:withObject:afterDelay:" mean? Could somebody give an example please?

-performSelector:withObject:afterDelay:

and

-performSelector:target:argument:order:modes:

injects a method to be sent into the event queue.

Most applications are event based. After launch, they sit and wait for events like key presses, environment changes, network data etc. Each incoming event triggers some method (piece of code) to be executed. The above methods enqueue such an event to be executed _after_ the current method finished and other waiting events are done. In opposite, just sending a -performSelector: would execute the method immediately, within the current event triggered method. For more details, see NSRunloop.

In case of showing sheets or drawers, this makes the difference.

Can't say which of the above methods is more effective, for most cases they have the same effect. I use the later one as the first one probably sets up an useless NSTimer.


To inject "myMethod", you could use:

[[NSRunLoop currentRunLoop] performSelector:@selector(myMethod)
target:self argument:nil order:0
modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]];


Hope that helps,

Markus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/
_______________________________________________
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.

References: 
 >Re: How do I open an NSDrawer in awakeFromNib? (From: Thilo Ettelt <email@hidden>)

  • Prev by Date: Re: How to change default font for NSTextView?
  • Next by Date: Re: Strings
  • Previous by thread: Re: How do I open an NSDrawer in awakeFromNib?
  • Next by thread: Re: How do I open an NSDrawer in awakeFromNib?
  • Index(es):
    • Date
    • Thread