-
Notifications
You must be signed in to change notification settings - Fork 115
Open
Description
@implementation DWURunLoopWorkDistribution
- (instancetype)init
{
if ((self = [super init])) {
_maximumQueueLength = 30;
_tasks = [NSMutableArray array];
_tasksKeys = [NSMutableArray array];
// _timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(_timerFiredMethod:) userInfo:nil repeats:YES];
// 如果不加延迟会导致启动黑屏, 可能是由于启动 App 时, 无法正常 Mode 切换的原因;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
NSRunLoop* runLoop = [NSRunLoop currentRunLoop];
[runLoop addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode];
[runLoop run];
});
}
return self;
}
Metadata
Metadata
Assignees
Labels
No labels