iOS 线程
1. pthread 1). 执行不带参数的方法 import <pthread/pthread.h> - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { // 创建子线程,线程编号 pthread_t pthread; // 第一个参数 线程编号的地址 // 第二个参数 线程的属性 // 第三个参数 线程的要执行的函数 // 第四个参数 要执行的函数的参数 // 返回值 int 0是成功 非0是失败 int result = pthread_create(&pthread, NULL, demo, NULL); NSLog(@"touchesBegan %@", [NSThread currentThread]); if (result) { NSLog(@"失败"); } else { NSLog(@"成功"); } } // 函数必须是C语言的 void *demo(void *param) { NSLog(@"hello %@", [NSThr...