zoukankan      html  css  js  c++  java
  • 四、线程管理————NSThread

    1、创建新线程的三种方式,例如:

    NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(demo:) object:nil];
    [thread start];
    [NSThread detachNewThreadSelector:@selector(demo:) toTarget:self withObject:nil];
        [self performSelectorInBackground:@selector(demo:) withObject:nil]; 准确的说此方法是NSObject的

    2、NSThread在调试中的使用

        ·    获得线程的属性:name,stackSize,threadPriority

        ·    管理线程的类方法:start、exit、sleep

        ·    获得当前线程和主线程:   [NSThread currentThread]  、[NSThread mainThread];

  • 相关阅读:
    关于表单的jQuery练习
    jQuery中的综合动画
    jQuery中自定义简单动画的实现
    清除浮动
    定位
    盒子模型
    笔记
    笔记
    翻页
    DOM
  • 原文地址:https://www.cnblogs.com/David-SU/p/5274385.html
Copyright © 2011-2022 走看看