zoukankan      html  css  js  c++  java
  • 线程间的通信

    开辟新的线程:

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

    [self performSelectorInBackground:@selector(download) withObject:nil];

     

    子线程与主线程的通信:

    [self performSelectorOnMainThread:@selector(showImg:) withObject:image waitUntilDone:NO];//最后参数传NO表示不需要等待该方法执行完毕

    [self performSelector:@selector(download) onThread:[NSThread mainThread] withObject:nil waitUntilDone:NO];

  • 相关阅读:
    awk-使用
    缓存使用
    一致性hash-java实现treemap版
    线程同步-CountDownLatch
    一致性hash算法
    linux-配置字符串-grep
    linux-查找命令-find
    linux-网络监控命令-netstat进阶
    linux-网络监控命令-netstat初级
    linux-单引号、双引号、反引号的区别。
  • 原文地址:https://www.cnblogs.com/dashengios/p/10389108.html
Copyright © 2011-2022 走看看