pthread和NSthread的记录

2016-12-06  本文已影响12人  什么的黑夜

2.detachNewThreadSelector方式创建:

  [NSThread detachNewThreadSelector:@selector(run) toTarget:self withObject:nil];

3.performSelectorInBackground方式创建:

 //有两种方式
 //创建子线程:
 [self performSelectorInBackground:@selector(run) withObject:nil];
 //回到主线程:
 [self performSelectorOnMainThread:@selector(backMainThread) withObject:nil waitUntilDone:YES];
上一篇 下一篇

猜你喜欢

热点阅读