Re: Blocks with return type
Re: Blocks with return type
- Subject: Re: Blocks with return type
- From: Quincey Morris <email@hidden>
- Date: Sat, 29 Sep 2012 20:40:06 -0700
On Sep 29, 2012, at 19:41 , "Gerriet M. Denkmann" <email@hidden> wrote:
> LongBlock_t aBlock = <...some magic here...> { (void)a; unsigned long x = 5; return x;};
>
> What should <...some magic here...> look like?
LongBlock_t aBlock = ^ unsigned long (id a) {...};
If the return type is 'void' it can be omitted; if there are no parameters, the entire parameter list (including parentheses) can be omitted.
_______________________________________________
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