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 protected]>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to