Block 的小技巧
//在block里再改变 指针的属性 设置为weak的strong
//判断string的值是否为NULL 不为NULL执行需要的代码
#define WS(weak_self) _weak typeof(self) weak_self = self
//block的防止循环引用的问题
_weak typeof(self) weak_self = self;
dispath_block block = ^{
[weakself xxxxxx];
}
//防止block里面的weak self is nil
_weak type(self) weak_self = self
class.Block = ^{
_strong typefo(self) strong_self = weak_self
if(strong_self){//判断weak_self is NULL
//执行代码
}else{
return //直接返回
}
}