NSTimer崩溃

感谢您的帮助。试用基本的progressIndicator动画。这崩溃了,并指出:“ TO8 Generator经过优化编译-步进的行为可能很奇怪;变量可能不可用。” TO8 Generator显然是应用程序。

消息:“选择器'scheduledTimerWithTimeInterval:selector:userInfo:repeats:'的未知类方法

有见识吗?再次谢谢你。

NSTimer *timer;
int count;  

if(!timer)
{
    timer = [NSTimer scheduledTimerWithTimeInterval:0.01
                                             target:self
                                           selector:@selector(checkThem:)
                                           userInfo:nil
                                            repeats:YES];
    [progressBar startAnimation: self];
}

-(void)checkThem:(NSTimer *)aTimer
{
    count++;
    if(count > 100)
    {
        count = 0;
        [timer invalidate];
    
        timer = NULL;
        [progressBar setDoubleValue:0.0];
        [progressBar stopAnimation: self];
    }
    else
    {
        [progressBar setDoubleValue:(100.0 * count) / 100];
    }
}
iCMS 回答:NSTimer崩溃

Andy的评论提示我检查我的Scheme配置。启用了“ DeBug可执行文件”。因此,该函数在编译后将无法使用。然后,我禁用了该选项。这样做之后一切都很好。对不起,麻烦了。

本文链接:https://www.f2er.com/1669371.html

大家都在问