Thread issues
Wisors opened this issue · comments
Wisors commented
The status bar with duration failed dismiss if you use it not in the main thread. Your thread exit earlier then the method performSelector:withObject:afterDelay:duration will be invoked.
Solution:
Modify the next method:
- (void)showMessage:(NSString *)message withStatus:(BWStatusBarOverlayStatus)status duration:(NSTimeInterval)duration animated:(BOOL)animated
You should add run loop at the end of this method:
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:duration]];
It prevent the exit of statusBar's thread.
Kyle commented
But this is a UI stuff, why shouldn't it be called on the main thread?