Wie verhindert man, dass UIButton beim Aktualisieren des Titels blinkt?

Wenn ich rufen Sie setTitle auf einem UIButton, der Taste blinkt in iOS 7. Ich habe versucht, myButton.hervorgehoben = NEIN, aber das hat nicht aufhören die Taste zu blinken.

[myButton setTitle:[[NSUserDefaults standardUserDefaults] stringForKey:@"elapsedLabelKey"] forState:UIControlStateNormal];

myButton.highlighted = NO;

Hier ist, wie Stelle ich den timer ein, aktualisiert den Titel:

- (void)actionTimer {
    if (myTimer == nil) {

        myTimer = [NSTimer scheduledTimerWithTimeInterval: 1.0
                        target: self
                        selector: @selector(showActivity)
                        userInfo: nil
                        repeats: YES];
    }
}

Hier ist die Methode, die eigentlich updates der Titel:

- (void)showActivity {

    NSString *sym = [[NSLocale currentLocale] objectForKey:NSLocaleCurrencySymbol];

    if (pauseInterval == nil) {

        //Update clock
        seconds = [[NSDate date] timeIntervalSinceDate:startInterval] - breakTime;

        //Update total earned
        secRate = rate.value /60 /60;
        total = secRate * seconds;
        [totalLabel setTitle:[NSString stringWithFormat:@"%@%.4f",sym,total] forState:UIControlStateNormal];

        days = seconds /(60 * 60 * 24);
        seconds -= days * (60 * 60 * 24);
        int hours = seconds /(60 * 60);
        fhours = (float)seconds /(60.0 * 60.0);
        seconds -= hours * (60 * 60);
        int minutes = seconds /60;
        seconds -= minutes * 60;

        //Update the timer clock
        [elapsed setTitle:[NSString stringWithFormat:@"%.2i:%.2i:%.2i:%.2i",days,hours,minutes,seconds] forState:UIControlStateNormal];
    }
}

InformationsquelleAutor der Frage FierceMonkey | 2013-10-15

Schreibe einen Kommentar