当无法应用程序进入背景的iOS 7中使用applicationDidEnterBackground更新视图: [英] Unable to update view when app goes into background in iOS 7 using applicationDidEnterBackground:

查看:202
本文介绍了当无法应用程序进入背景的iOS 7中使用applicationDidEnterBackground更新视图:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序进入后台,我改变了看法,以prepare它回来到前台。在iOS 6中,我在做什么优秀作品。然而,在搭载iOS 7,这是行不通的。

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.

我试图隐藏和显示一些UILabels是这样的:

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;
    }
}

这一切code,当我设置断点被解雇,但似乎并没有做任何事情。我还测试了 hideTimerLabels showTimerLabels 的方法和他们iOS中7,做工精细

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.

推荐答案

看起来这仅仅是在模拟器上发生的事情。在与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.

这篇关于当无法应用程序进入背景的iOS 7中使用applicationDidEnterBackground更新视图:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆