NSUserDefaults errors in logs

后端 未结 6 981
慢半拍i
慢半拍i 2021-01-03 21:08

I get some error messages in logs

[User Defaults] Failed to write value for key GameId in CFPrefsPlistSource<0x1740faf00> (Domain: xxx.xxxxxx, User

6条回答
  •  花落未央
    2021-01-03 21:37

    if you suffer this problem when you try to save data to extension APP by using userDefault,maybe you had written this code : [[NSUserDefaults standardUserDefaults] initWithSuiteName:@"group.xxx.com"];,this code reset default userDefault. Actually,the correct code is : [[NSUserDefaults alloc] initWithSuiteName:@"group.xxx.com"]; http://www.jianshu.com/p/e782104c3bc3

提交回复
热议问题