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);
}

複製代碼
相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息