// 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];//切換到主線程中