标签:
#import <pthread.h>
@interface ViewController ()
@end
@implementation ViewController
void * run(void *param){
for (int i=0; i<50000; i++) {
NSLog(@"run%@",[NSThread currentThread]);
}
return NULL;
}
- (IBAction)action:(id)sender {
pthread_t thread;
pthread_create(&thread, NULL, run, NULL);
}
标签:
原文地址:http://www.cnblogs.com/xiezefeng/p/5427265.html