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);
}
複製代碼