开发者

Writing changes to a complex CFPreferences structure

开发者 https://www.devze.com 2023-03-07 14:27 出处:网络
I can easily see how to add hierarchical data to a plist file via the CFPreferences api. However, whats far less obvious how to read from a CFPreferences a value stored inside a CFDictionary (that m

I can easily see how to add hierarchical data to a plist file via the CFPreferences api.

However, whats far less obvious how to read from a CFPreferences a value stored inside a CFDictionary (that might be stored in tur开发者_StackOverflow社区n, in a CFDictionary), and change it.


You can’t, you have to replace the root element. If this is too cumbersome, that’s a sign that you should be using model objects rather than collections and possibly move away from CFPreferences/NSUserDefaults to some other storage mechanism, perhaps Core Data.

0

精彩评论

暂无评论...
验证码 换一张
取 消