方式一:
[mTabl reloadData];
[self performSelector:@selector(test) withObject:nil afterDelay:0];
image.png
- (void)performSelector:(SEL)aSelector withObject:(nullable id)anArgument afterDelay:(NSTimeInterval)delay;
delay传0,并不是立即执行aSelector。系统等待当前runloop执行,直到空闲,尽快aSelector
方式二:
[mTabl reloadData];
[mTabl layoutIfNeeded];
[self test];
image.png
方式三:
[mTabl reloadData];
dispatch_async(dispatch_get_main_queue(), ^{
[self test];
});
image.png
网友评论