Advertisement
Guest User

Untitled

a guest
Sep 11th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #import <Foundation/Foundation.h>
  2.  
  3. int main (int argc, char * argv[])
  4. {
  5.     NSObject *captureObject = [NSObject new];
  6.  
  7.     NSLog(@"Before block: %lu", [captureObject retainCount]);
  8.    
  9.     void (^block)() = ^{
  10.         NSLog(@"Inside block: %lu", [captureObject retainCount]);
  11.     };
  12.    
  13.     NSLog(@"After block creation: %lu", [captureObject retainCount]);
  14.    
  15.     block();
  16.    
  17.     NSLog(@"After block call: %lu", [captureObject retainCount]);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement