应用关闭后如何保存图片状态?

时间:2019-05-31 05:20:20

标签: ios swift uiimageview

在iOS应用中,用户可以更改Account AccountDb::get_account(int account_number) { for (auto &account_element : account_list_) { Account account = account_element; bool account_found = (account.account_number() == account_number); if (account_found) { return account; } } // no matching Account return ???; } 的颜色。当他们单击UIImage时,颜色会改变。但是,退出应用程序时,我遇到以下问题:

  1. 我最近在关闭应用程序时开始获取此信息: PAC评估错误:UIButton
  2. 当我返回到应用程序时,UIImage会恢复为标准颜色

我不擅长在应用程序委托中执行操作,但是我确定必须在以下内容中执行某些操作:

NSURLErrorDomain: -1003

这是我的func applicationWillTerminate(_ application: UIApplication) 按钮功能中的功能:

UIViewController

我尝试将其添加到应用程序委托的myImage.image = UIImage(named: "newImage.png")! ViewController().myImage.image = UIImage(named: "newImage.png") 函数中,但没有骰子。

当我更改applicationWillTerminate的颜色,然后关闭应用程序时,该应用程序不应崩溃。相反,该应用应该能够使用新图像作为UIImageView重新打开。

0 个答案:

没有答案