gup*_*ron 4 background objective-c foreground ios ios7
当我的应用程序进入后台时,我正在更改视图以准备它回到前台.在iOS 6中,我正在做的工作正常.但是在iOS 7中,它无法正常工作.
我试图隐藏并显示一些像这样的UILabel:
//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;
}
}
Run Code Online (Sandbox Code Playgroud)
当我设置断点时,所有这些代码都会触发,但似乎没有做任何事情.我也测试了这些hideTimerLabels和showTimerLabels方法,它们在iOS 7中运行良好.
| 归档时间: |
|
| 查看次数: |
1577 次 |
| 最近记录: |