IOS-NSThread

NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(demo:) object:@"hello NSThread"];
    [thread start];
    
[NSThread detachNewThreadSelector:@selector(demo:) toTarget:self withObject:@"hello NSThread2"];

[self performSelectorInBackground:@selector(demo:) withObject:@"hello NSThread3"];

- (void)demo:(NSString *)name {
    
    NSLog(@"param %@", name);
}

复制代码
相关文章
相关标签/搜索
本站公众号
   欢迎关注本站公众号,获取更多信息