“Reading from public effective user settings” in iOS 10

限于喜欢 提交于 2019-11-26 08:14:24

问题


I\'m getting the following messages when launching my app:

2016-10-12 14:47:23.705002 Discovery[377:147958] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2016-10-12 14:47:23.712212 Discovery[377:147958] [MC] Reading from public effective user settings.

Is \"system group container\" related to App Groups? I do share data between apps using an App Group and was wondering if this caused this message to be displayed?

I set the data in one app like this:

var userDefaults = NSUserDefaults(suiteName: \"group.com.company.myApp\")
userDefaults!.setObject(\"user12345\", forKey: \"userId\")
userDefaults!.synchronize()

And I retrieve it in another app using something like this:

var userDefaults = NSUserDefaults(suiteName: \"group.com.company.myApp\")
if let testUserId = userDefaults?.objectForKey(\"userId\") as? String {
  print(\"User Id: \\(testUserId)\")
}

Did something change in iOS 10 that would cause any problems or cause these messages to show up?


回答1:


This is a bug (now we're finding out it might be a permanent message) and it seems that this message appears primarily when clicking on a Text Field or Text View or other similar NSObject.

This is only a log message and not a compile error message as signified by the date and time preceding the message. Therefore if your code is not working it is not a result of this console message.

If you run on a device the message will be [MC] Reading from public effective user settings. If you run on the sim the message will be [MC] Reading from private effective user settings.




回答2:


  • Go to Xcode -> Product -> Scheme -> Edit Scheme
  • In the Environment Variables, add OS_ACTIVITY_MODE as name and disable as value.

I hope this helps you.




回答3:


Xcode seems to full of these confusing and misleading warnings. this warning appears when ever I enter text in a UITextField, at first I thought there is something wrong with my codes.




回答4:


Is your next output in console like this: [access] <private>. I've had your warnings, I was missing permission for camera usage in my plist file Privacy - Camera Usage Description. You need privacy description in plist for which privacy you are using: Contacts, Calendar, Reminders, Photos, Bluetooth Sharing, Microphone, Camera, Location, Health, HomeKit, Media Library, Motion, CallKit, Speech Recognition, SiriKit, TV Provider




回答5:


I had this same problem when touching a Bar button that showed an alert, which in turn has a TextField. Any way I solved this matter using the proposal commented in this link. It works at least for me! regards!




回答6:


I was struggling with this issue in an iPhone5 emulator (on the device everything was ok) that stucked my Ionic app after touch a TextInput, and then I changed the emulator to another one, like iPhone6, or iPhone8, and everything worked again.



来源:https://stackoverflow.com/questions/40024316/reading-from-public-effective-user-settings-in-ios-10

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!