When my app goes into the background, I'm changing the view to prepare it for coming back into the foreground. In iOS 6, what I'm doing works fine. However in iOS 7, it is not working.

I'm trying to hide and show some UILabels like this:

//AppDelegate.m
- (void)applicationDidEnterBackground:(UIApplication *)application
{
    [self.timerVc hideTimerLabels];
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    [self.timerVc showTimerLabels];
}


//TimerVC.m
- (void)hideTimerLabels {
    for (UILabel *label in self.timerLabels) {
        label.hidden = YES;
    }
}

- (void)showTimerLabels {
    for (UILabel *label in self.timerLabels) {
        label.hidden = NO;
    }
}

All of this code is firing when I set breakpoints, but doesn't seem to do anything. I've also tested the hideTimerLabels and showTimerLabels methods and they work fine in iOS 7.

有帮助吗?

解决方案

It looks like this is only happening in the simulator. On an actual device with iOS 7, it works as expected. Another reminder, to test on the device more often.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top