标签:blog io 使用 sp for on div log bs
第一种
typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize); @interface ssyTest : NSObject { SDWebImageDownloaderProgressBlock ssyblock; } - (void)testssy:(NSString *)str block:(SDWebImageDownloaderProgressBlock)ssy;
#import "ssyTest.h" @implementation ssyTest - (void)testssy:(NSString *)str block:(SDWebImageDownloaderProgressBlock)ssy { ssyblock = ssy; [self performSelector:@selector(jjj) withObject:nil afterDelay:5]; } - (void)jjj { ssyblock(1,2); }
ssyTest *ssy = [[ssyTest alloc] init]; [ssy testssy:@"3" block:^(NSInteger s1,NSInteger s2){ NSLog(@"%d %d",s1,s2); }];
第2中
- (void)testCallback:(void (^)(int ssy,NSString *str))callback;
- (void)testCallback:(void (^)(int ssy,NSString *str))callback { callback(5,@"ssy"); }
[ssy testCallback:^(int index,NSString *str){ NSLog(@"%d %@",index,str); }];
标签:blog io 使用 sp for on div log bs
原文地址:http://www.cnblogs.com/yunis/p/4113265.html