// 1. 创建子线程
[self performSelectorInBackground:<#(SEL)#> withObject:<#(id)#>];
// 2. 创建了一个新的子线程
[NSThread detachNewThreadSelector:@selector(print) toTarget:self withObject:nil];
// 3. 通过创建NSThread对象的方式实现多线程
NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(print) object:nil];
[thread start];
[thread cancel];
// 4. 继承NSThread
MyThread *thread = [[MyThread alloc] init];
[NSThread isMainThread] //判断线程是否在主线程中
[self performSelectorOnMainThread:@selector(download:) withObject:data waitUntilDone:YES];//切换到主线程中