0

我正在尝试通过 NSTimer 跟踪带有动画的标签。当您开始计算应用程序崩溃时,会出现以下错误:

- [ PFObject objectForKey : ] : message sent to deallocated instance 0x9d500b0

我的问题是什么?我在哪里做错了?

PS 在我的应用程序中,我正在使用 Parse.com

我向您展示了产生问题的代码:

-(void)FFQueryForDatiEsami {

    FFTitoloEsameLabel.text = [FFObjectForDetails1 objectForKey:FF_ESAMI_TITOLO];
    NSNumber * CFUNumber = [FFObjectForDetails1  objectForKey:FF_ESAMI_CFU];
    FFCFULabel.text = [NSString stringWithFormat:@"%d",[CFUNumber intValue]];
    NSDateFormatter *FFDataFormattata = [[NSDateFormatter alloc] init];
    [FFDataFormattata setDateFormat:FF_DATE_FORMATTER];
    FFDataConvalidaEsameLabel.text = [NSString stringWithFormat: @"Convalidato in data %@",[FFDataFormattata stringFromDate:FFObjectForDetails1.updatedAt]];
    FFProgrammazioneEsameLabel.text = [NSString stringWithFormat: @"Questo esame era stato programmato per il %@",[FFDataFormattata stringFromDate:[FFObjectForDetails1 objectForKey:FF_ESAMI_DATA_STRING]]];

    [NSTimer scheduledTimerWithTimeInterval:0.020
                                     target:self 
                                   selector:@selector(CalcoloVotazione)
                                   userInfo:nil
                                    repeats:YES];

}

-(void) CalcoloVotazione{
    NSTimer *Timer;
    NSNumber * myNumber = [FFObjectForDetails1  objectForKey:FF_ESAMI_VOTAZIONE];

    FFVotazioneLabel.text = [NSString stringWithFormat:@"%d",TickNumber];
    int number = [myNumber intValue];


    TickNumber++;
    if(TickNumber > number ){
        [Timer invalidate];
        Timer = nil;
    }     
}
4

0 回答 0