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.
Thankyou for your time and patience if this happens to be impossible, or very easy.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…