This repository is currently being migrated. It's locked while the migration is in progress.
[Enhancement] for now, GVUserDefaults could save custom object directly!#35
Open
MrPans wants to merge 1 commit intogetsling:masterfrom
Open
[Enhancement] for now, GVUserDefaults could save custom object directly!#35MrPans wants to merge 1 commit intogetsling:masterfrom
MrPans wants to merge 1 commit intogetsling:masterfrom
Conversation
Author
|
NSUserDefault的文档中说明了,所有存进去的对象都是immutable的。这就意味着,直接取出修改对象内的是无效的。需要修改后再次把整个对象 set 一次才会生效。
另外存储是持久化在硬盘里,修改对象内的属性是修改内存中数据,是不会同步的。
… 在 2017年11月5日,18:48,wonin ***@***.***> 写道:
@wonin commented on this pull request.
你好,我测试修改对象属性无效。
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Author
|
还有,想要存储的对象需要满足 NSCoding 协议 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
extend the persistent types to any object which conform NSCoding protocol.