zoukankan      html  css  js  c++  java
  • NSUserDefaults保存问题

    If you terminate your app by pressing the home button (in the Simulator or on the device), your User Defaults will get saved.

    If you terminate your app by pressing "Stop" in Xcode (in the Simulator or on the device), your User Defaults might get saved, but there's a good chance they won't. NSUserDefaults persists any changes periodically, and if you terminate the process before they've been persisted, they'll be gone. You can force the save by calling:

    [[NSUserDefaults standardUserDefaults] synchronize];


    来自 :http://stackoverflow.com/questions/2622754/why-is-nsuserdefaults-not-saving-my-values/2622940#2622940

    模拟器中按stop终止程序可能会没有保存数据。对于关键数据建议手动synchronize同步一次。
  • 相关阅读:
    孤儿进程与僵尸进程
    python with as的用法
    工作目录与os.getcwd()
    内置模块
    迭代器,生成器
    表达式,语句
    字符流
    字节流
    File
    触发器的操作
  • 原文地址:https://www.cnblogs.com/york/p/2803211.html
Copyright © 2011-2022 走看看