Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top