objective-c 中block语法中的传值

 

                  

1     typeof (NSString*) __weak str = @"this is a test";
2     double delayInSeconds = 2.0;
3     dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
4     dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
5         NSLog(@"%@",str);
6     });

 

posted @ 2014-03-18 14:00  optt  阅读(195)  评论(0)    收藏  举报