summaryrefslogtreecommitdiffhomepage
path: root/objective-c.html.markdown
diff options
context:
space:
mode:
authorDivay Prakash <divayprakash@users.noreply.github.com>2018-10-24 11:04:05 +0530
committerGitHub <noreply@github.com>2018-10-24 11:04:05 +0530
commit4a7d678c2553bc379542a5901177b8bb2730ce65 (patch)
treeb2896f9f02b5a752f860a71a36b1e16c566a8ed7 /objective-c.html.markdown
parente2949649f054ca069e95a05b04d99bccc30ba45d (diff)
parent8f5a67190705c9a3101653901d8f8a7b48eb1775 (diff)
Merge branch 'master' into master
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.