Is it possible in Objective-C to create a block inline and use its return type? For example, can I create a block that returns a BOOL
, have it be inline, and use its return type for an assignment.
BOOL b = <inline block that returns BOOL> { // unsure of the syntax / legality of this
return YES; // will be more logic in here, that is why I want to use a block.
};
I am having trouble with the block syntax, and am unsure if a block can be created inline. I have checked the following resources with no avail.
- Block Cheat Sheet
- Gosh Darn Block Syntax
- And of Course, The Apple Documentation
Thankyou for your time and patience if this happens to be impossible, or very easy.
See Question&Answers more detail:os