Welcome to Blockoland Objective C Blocks                                also known as closures.               Block Name  ...
Block Declarations with       Typedefs                  also known as closures.                         Block Name        ...
Upcoming SlideShare
Loading in …5
×

Blocks Objective C

1,024 views
945 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,024
On SlideShare
0
From Embeds
0
Number of Embeds
321
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • Blocks Objective C

    1. 1. Welcome to Blockoland Objective C Blocks also known as closures. Block Name argumentsvoid (^helloBlock)(void) = ^ void (void){ NSLog(@"Hello, World!"); };Return Type Block LogicBlocks were part of Smalltalk They were not a high priority for Objective-C, initially.
    2. 2. Block Declarations with Typedefs also known as closures. Block Name arguments typedef BOOL (^resultHandler)(id result, NSError *error); Return Type BOOL (^resultHandler)(id result, NSError *error); ResultHandler resultHandler; ResultHandler resultHandler = ^ BOOL (id result, NSError *error) {     [result performSomeTask];     return YES; }; more info

    ×