#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
// 方式一:
// [NSThread detachNewThreadSelector:@selector(nextThread) toTarget:self withObject:nil];
// 方式二:
// [self performSelectorInBackground:@selector(nextThread) withObject:nil];
// 方式三:
NSThread *thread = [[NSThread alloc]initWithTarget:self selector:@selector(nextThread) object:nil];
[thread start];
}
-(void)nextThread
{
NSLog(@"%@",[NSThread currentThread]);
}
@end