zoukankan      html  css  js  c++  java
  • iOS NSProgress的使用

    @interface ZXViewController ()

    @property (nonatomic, strong) NSProgress *pro;

    - (IBAction)btnOnClick:(id)sender;

    @end

    @implementation ZXViewController

    - (void)viewDidLoad

    {

        [super viewDidLoad];

        NSProgress *pro = [NSProgress progressWithTotalUnitCount:10000.0];

        

        // 注册一个监听器  KVO

        [pro addObserver:self forKeyPath:@"fractionCompleted" options:NSKeyValueObservingOptionNew context:nil];

       

    }

    - (IBAction)btnOnClick:(id)sender {

        // 模拟改变他的属性

        self.pro.completedUnitCount += 100;

    }

    // 监听到了属性改变会调用这个方法

    - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context

    {

        NSLog(@"lskdjfl=  %f",self.pro.fractionCompleted);

    }

    @end

  • 相关阅读:
    Matrix-tree 定理的一些整理
    多项式
    多项式
    vijos 1641 Vs Snowy
    noip 提高组 2010
    军训有感
    我的将军啊
    洛谷 P3302 [SDOI2013]森林
    关于线段树
    关于KMP
  • 原文地址:https://www.cnblogs.com/likuiliang/p/3993102.html
Copyright © 2011-2022 走看看