Fix issue with calling block code.

Fixes https://github.com/adambard/learnxinyminutes-docs/issues/1598
This commit is contained in:
Levi Bostian 2015-10-18 12:22:33 -05:00
parent 3d70c872e4
commit 3a968a826b

View File

@ -688,7 +688,7 @@ addUp = ^(int n) { // Remove (int n) to have a block that doesn't take in any pa
mutableVar = 32; // Assigning new value to __block variable. mutableVar = 32; // Assigning new value to __block variable.
return n + outsideVar; // Return statements are optional. return n + outsideVar; // Return statements are optional.
} }
int addUp = add(10 + 16); // Calls block code with arguments. int addUp = addUp(10 + 16); // Calls block code with arguments.
// Blocks are often used as arguments to functions to be called later, or for callbacks. // Blocks are often used as arguments to functions to be called later, or for callbacks.
@implementation BlockExample : NSObject @implementation BlockExample : NSObject