• 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 to get the dispatch queue for the current thread's runloop?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get the dispatch queue for the current thread's runloop?


  • Subject: Re: How to get the dispatch queue for the current thread's runloop?
  • From: Shane Stanley <email@hidden>
  • Date: Sat, 28 Jan 2012 18:00:00 +1100

On 28/01/2012, at 1:41 PM, Ken Thomases wrote:

> Believe it or not, this also works:
>
>    [(id)^{ ... code here ... } performSelector:@selector(invoke) withObject:nil afterDelay:5.0];
>
> That is, you can target performSelector:withObject:afterDelay: at a block, itself, rather than some other helper object.  And, a block implements the -invoke selector to, well, invoke itself.

FWIW, on stackoverflow there's a post suggesting the use of a block as a target, and using -invoke to select it. In the comments is one from bbum from last October:

> This "works" by coincidence. It relies on private API; the invoke method on Block objects is not public and not intended to be used in this fashion.

<http://stackoverflow.com/questions/4581782/can-i-pass-a-block-as-a-selector-with-objective-c>, about fourth answer down.

--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>


_______________________________________________

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


References: 
 >How to get the dispatch queue for the current thread's runloop? (From: Jens Alfke <email@hidden>)
 >Re: How to get the dispatch queue for the current thread's runloop? (From: Ken Thomases <email@hidden>)

  • Prev by Date: Trying to customize UITableViewCell with IB but having odd exception
  • Next by Date: Re: How to get the dispatch queue for the current thread's runloop?
  • Previous by thread: Re: How to get the dispatch queue for the current thread's runloop?
  • Next by thread: Re: How to get the dispatch queue for the current thread's runloop?
  • Index(es):
    • Date
    • Thread