iOS: 定义 Block

 定义

typedef void (^RFAudioBasicBlock) (void);
typedef void (^RFAudioSuccessBlock) (BOOL flag);
typedef void (^RFAudioSuccessDetailBlock) (BOOL flag, NSURL *url, NSTimeInterval duration);
typedef void(^RFAudioSuccessURLBlock) (BOOL flag, NSURL *url);

 作为参数

- (void)playWithURL:(NSURL *)url finishedBlock:(RFAudioSuccessDetailBlock)block;

 使用

[[RFAudioManager defaultManager] playWithURL:url finishedBlock:^(BOOL flag, NSURL *url) {
    NSLog(@"播放结束:%@", url);
}];

 

iOS: 定义 Block,布布扣,bubuko.com

iOS: 定义 Block

上一篇:oracle plsql utl_file


下一篇:如何使用PhoneGap打包Web App