下拉刷新偶现不能返回到顶部
kedu opened this issue · comments
描述bug
下拉刷新偶现不能返回到顶部
必现/偶发?
偶现
我的诉求是我替换了MJRefreshDispatchAsyncOnMainQueue会不会出现问题。因为这个解决了问题。
具体看我下面贴的代码
// 异步主线程执行,不强持有Self
//#define MJRefreshDispatchAsyncOnMainQueue(x)
//__weak typeof(self) weakSelf = self;
//dispatch_async(dispatch_get_main_queue(), ^{
//typeof(weakSelf) self = weakSelf;
//{x}
//});
#define MJRefreshDispatchAsyncOnMainQueue(x)
__weak typeof(self) weakSelf = self;
if ([NSThread isMainThread]) {
typeof(weakSelf) self = weakSelf;
{x}
} else {
dispatch_async(dispatch_get_main_queue(), ^{
typeof(weakSelf) self = weakSelf;
{x}
});
}
希望能快点回答一下我,我这个项目就要上线了。
谢谢你的回答。不会引起系统性问题的话,那我就先这样做。因为我感觉#1329的方案都差不多,而且延迟一小段时间再执行代码这个是时间是系统控制的,所以我这样就是时间特别快的情况。