Created
November 11, 2010 08:41
-
-
Save yllan/672209 to your computer and use it in GitHub Desktop.
Higher Order Function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef id(^TestBlock)(id); | |
TestBlock (^blockForModificationType)(NSString *) = ^(NSString *type) { | |
return (TestBlock)[[^(id obj) { | |
if ([[obj modificationType] isEqualToString: type]) return obj; | |
return (id)nil; | |
} copy] autorelease]; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, no, it's because the returned block is live on local stack!