summaryrefslogtreecommitdiffhomepage
path: root/objective-c.html.markdown
diff options
context:
space:
mode:
authorSmuSmu <SmuSmu@users.noreply.github.com>2018-10-29 10:38:48 +0100
committerGitHub <noreply@github.com>2018-10-29 10:38:48 +0100
commit1372607b2ae40edf54fe4d04e3dfd3b789016c8e (patch)
tree95d30e2ae24ffaf6acb66f671b20e6b75713f0c3 /objective-c.html.markdown
parent3a41a6006ff421b45ae46a521b900216ac28daf7 (diff)
parent9317733e2388ccafeea9c331443fe5f42b611390 (diff)
Merge pull request #1 from adambard/master
ff
Diffstat (limited to 'objective-c.html.markdown')
-rw-r--r--objective-c.html.markdown5
1 files changed, 4 insertions, 1 deletions
diff --git a/objective-c.html.markdown b/objective-c.html.markdown
index 04c4e529..de3884af 100644
--- a/objective-c.html.markdown
+++ b/objective-c.html.markdown
@@ -731,7 +731,10 @@ if ([myClass conformsToProtocol:@protocol(CarUtilities)]) {
///////////////////////////////////////
// Blocks are statements of code, just like a function, that are able to be used as data.
// Below is a simple block with an integer argument that returns the argument plus 4.
-int (^addUp)(int n); // Declare a variable to store the block.
+^(int n) {
+ return n + 4;
+}
+int (^addUp)(int n); // Declare a variable to store a block.
void (^noParameterBlockVar)(void); // Example variable declaration of block with no arguments.
// Blocks have access to variables in the same scope. But the variables are readonly and the
// value passed to the block is the value of the variable when the block is created.