Xcode messages

I posted this as a reply.to a previous post, but got no reply, so here is a new post.

I'm using. user defaults in an app with a self defined suite name. I had put aside work on the app for several months, and after returning to work on it, I'm getting xcode messages when testing, several like:

"Not updating lastKnownShmemState in CFPrefsPlistSource<0x600000358360> (Domain: mySuiteName, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: Yes): 1169 -> 1181"

Can anyone tell me what is wrong or point me to an answer.

Thanks for the post! It's always recommended to provide as much information as possible. The error message is very generic, so it would help to see the code causing the issue too. Could you post the problematic code or, better yet, create a simple and focused project to demonstrate the specific problem? This will make it easier for us to address and provide a more tailored solution.

Here are some ideas but really hard to answer without code or background information. The provided error message refers to an internal issue within the CoreFoundation framework, specifically within the CFPrefs system preferences service, encountered when using User Defaults in Xcode.

Potential reasons without knowing the full context and solutions for given message:

#1. User Defaults Race Condition

  • A concurrency issue can cause race conditions in the User Defaults subsystem. Different threads may write in to prefs, leading to unexpected negative value, if finest synchronization isn’t used correctly. Are you using the user default in other thread but the main thread?

#2. Mispractices of User Defaults

  • We should use User Defaults but there are incorrect usage scenarios which might cause this kind of issue. Some cases might include: Writing the same kind of definitive value repeatedly, or frequently using User Defaults over uncomprimised situations.

I'll try to put together a minimal app displaying these messages. Note however that no writing is being done to the user defaults. It has been stable and unchanged for several years (that is, the plist suite file.), and in the past I have never gotten these messages.

Xcode messages
 
 
Q