Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# 8.PerformSelector:afterDelay:这个方法在子线程中是否起作用? #8

Open
Jerryshen170918 opened this issue Dec 20, 2019 · 0 comments

Comments

@Jerryshen170918
Copy link

Jerryshen170918 commented Dec 20, 2019

[NSRunLoop.currentRunLoop run];开启runloop后可以用了

- (void)viewDidLoad {
    [super viewDidLoad];
    queue = dispatch_queue_create("asds", DISPATCH_QUEUE_CONCURRENT);
    dispatch_async(queue, ^{
        [self performSelector:@selector(testSel:) withObject:@"asdfd" afterDelay:3];
        [NSRunLoop.currentRunLoop run];
    });
}
- (void)testSel:(id)sender{
    NSLog(@"%s=%@",__FUNCTION__,sender);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant