Re: How to get the dispatch queue for the current thread's runloop?
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