iOS定时器,指定时间后触发。

    xiaoxiao2021-12-01  43

    NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:30.0f target:self selector:@selector(method) userInfo:nil repeats:NO]; NSDate *date = [NSDate date]; NSLog(@"date:%@",date); NSDate *fireDate = [NSDate dateWithTimeInterval:10.0f sinceDate:date]; [timer setFireDate:fireDate]; 另外:

    mark此文

    http://blog.csdn.net/chadeltu/article/details/44976527

    本人自建的一个iOS交流群165332140,欢迎各位大神进群交流指导。

    转载请注明原文地址: https://ju.6miu.com/read-679548.html

    最新回复(0)