zoukankan      html  css  js  c++  java
  • IOS6学习笔记(四)

    1.GCD设置一个timer计时器

    - (void)awakeFromNib {

        __weak id weakSelf = self;

        double delayInSeconds = 0.25;

        _timerdispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0,dispatch_get_main_queue());

        dispatch_source_set_timer(_timer, dispatch_walltime(NULL, 0),(unsigned)(delayInSeconds * NSEC_PER_SEC), 0);

        dispatch_source_set_event_handler(_timer, ^{

            [weakSelf updateValues];

        });

        dispatch_resume(_timer);

    }

    - (void)updateValues {

    }

    - (void)dealloc {

        dispatch_source_cancel(_timer);

    }

  • 相关阅读:
    python变量和作用域
    模块
    装饰器
    转git取消commit
    RTP
    ffmpeg编译
    win7开启wifi
    LIVE555
    【FFmpeg】ffplay播放rtsp视频流花屏问题
    Windows下编译SDL
  • 原文地址:https://www.cnblogs.com/jay-dong/p/3296540.html
Copyright © 2011-2022 走看看