gpt4 book ai didi

iphone - 当我的应用程序再次激活时如何重新加载我的 View ?

转载 作者:行者123 更新时间:2023-12-03 20:21:12 27 4
gpt4 key购买 nike

假设有人正在使用我的应用程序并更改设置捆绑中的设置,当他们返回我的应用程序时,我希望我的 View 根据这些设置进行更新(通过我的更新方法)。我尝试了很多不同的方法,但就是无法让它发挥作用。

为我的 iPhone 应用实现这种行为的最佳方式是什么?

最佳答案

在您的AppDelegate中放置这些方法:

- (void)applicationWillEnterForeground:(UIApplication *)application {
/*
Called as part of transition from the background to the active state: here you can undo many of the changes made on entering the background.
*/
}


- (void)applicationDidBecomeActive:(UIApplication *)application {
/*
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
*/
}

然后你就可以做任何你想做的事了。

关于iphone - 当我的应用程序再次激活时如何重新加载我的 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4750332/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com