Created
January 29, 2015 03:44
-
-
Save lin/4d16ac922b6c9e55ba1b to your computer and use it in GitHub Desktop.
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
| void (^logMessage) = ^{ | |
| NSLog(@"Hello from inside the block"); | |
| }; | |
| void (^sumNumbers)(NSUInteger, NSUInteger) = ^(NSUInteger num1, NSUInteger num2){ | |
| NSLog(@"The sum of the numbers is %lu", num1 + num2); | |
| }; | |
| for (NSString *word in funnyWords) { | |
| NSLog(@"%@ is a funny word", word); | |
| } | |
| [funnyWords enumerateObjectsUsingBlock: | |
| ^(NSString *word, NSUInteger index, BOOL *stop){ | |
| NSLog(@"%@ is a funny word", word); | |
| } | |
| ]; | |
| @interface Person : NSObject | |
| @property NSString *firstName; | |
| @property NSString *lastName; | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment