OSX首选项文件-removePersistentDomainForName在10.8中具有不同的功能吗? [英] OSX preferences file - removePersistentDomainForName has different functionality in 10.8?

查看:99
本文介绍了OSX首选项文件-removePersistentDomainForName在10.8中具有不同的功能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码适用于10.7上的一位开发人员,但不适用于10.8上的我

This code works for one of our developers on 10.7 but not for me on 10.8

working =删除捆绑软件的首选项.plist文件. 10.7上的开发人员也有一个锁文件,而我没有.这不是文件访问的问题-我尝试过[resetStandardUserDefault]并创建了一个新文件,但这并不是我们要做的.

working = it deletes the preferences .plist file for the bundle. The dev on 10.7 also has a lockfile whereas I do not. It's not a problem of file access - I tried [resetStandardUserDefault] and that made a new file, but that's not exactly we want to do.

NSString *appDomain = [[NSBundle mainBundle] bundleIdentifier];        
        [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomain];

我在查找有关10.8中的更改的任何信息时遇到麻烦-这听起来对任何人都熟悉吗?

I am having trouble locating any info about changes in 10.8 - does this sound familiar to anyone?

推荐答案

我遇到了同样的问题,实际上似乎没有任何更改的信息,也没有收到任何错误或警告. [NSUserDefaults resetStandardUserDefault]对我没有任何帮助.我目前所做的只是简单地覆盖默认值以将其重置(给[[NSUserDefaults standardUserDefaults] setValuesForKeysWithDictionary: [NSDictionary dictionaryWithObjectsAndKeys:...]]与最初提供给[[NSUserDefaults standardUserDefaults] registerDefaults: [NSDictionary dictionaryWithObjectsAndKeys:...]]的输入相同.)

I have the same issue and indeed there seems to be no info about any changes, also don't get any errors or warnings. [NSUserDefaults resetStandardUserDefault] doesn't do anything for me. What I do currently is simply overwrite the default values to reset them (give [[NSUserDefaults standardUserDefaults] setValuesForKeysWithDictionary: [NSDictionary dictionaryWithObjectsAndKeys:...]] the same input as originally given to [[NSUserDefaults standardUserDefaults] registerDefaults: [NSDictionary dictionaryWithObjectsAndKeys:...]].

并不是一个真正的答案,但我没有足够的代表对此发表评论.

Not really an answer, but I don't have enough rep to comment..

这篇关于OSX首选项文件-removePersistentDomainForName在10.8中具有不同的功能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆