IOS about Nsuserdefault

Source: Internet
Author: User
Reprint is not all things can be put in. Nsuserdefaults only supports: NSString, NSNumber, NSDate, Nsarray, Nsdictionary. The Nsuserdefaults method used to record the permanent data is very convenient, do not need to read and write files, but retained in a nsdictionary dictionary, saved to the file by the system, the system will be saved to the application/library/preferences/ The Gongcheng.plist file.
It is important to note that if the program exits unexpectedly, Nsuserdefaults standarduserdefaults data is not written to the file by the system, but can be used [[Nsuserdefaults standarduserdefaults] Synchronize] Calling the Synchronize function will immediately update these defaults instead of waiting for the program to terminate to avoid data loss

If you save a custom class in a Nsarray, and then save it in Nsuserdefaults, it will not succeed. Do not believe can try, if you succeed please tell me.

What about that?

Workaround Join blog:http://blog.csdn.net/chyroger/article/details/5785297

IOS about Nsuserdefault

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.