(void(^)(POPAnimation *anim, BOOL finished)) block
blcok写在了属性中.
@property (nonatomic,strong) void(^monitoringBlock)(CMTime time);
在多线程环境下(block中的weakSelf有可能被析构的情况下),需要先将self转为strong指针,避免在运行到某个关键步骤时self对象被析构。
__weak __typeof(self)weakSelf = self;
AFNetworkReachabilityStatusBlock callback = ^(AFNetworkReachabilityStatus status) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
strongSelf.networkReachabilityStatus = status;
if (strongSelf.networkReachabilityStatusBlock)
{
strongSelf.networkReachabilityStatusBlock(status);
}
};