iOS 10 中的“从公共有效用户设置中读取”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40024316/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 10:34:50  来源:igfitidea点击:

"Reading from public effective user settings" in iOS 10

iosswiftios10

提问by TenaciousJay

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?

iOS 10 中是否有什么变化会导致任何问题或导致这些消息出现?

回答by Edison

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.

这是一个错误(现在我们发现它可能是一条永久性消息),似乎该消息主要在单击文本字段或文本视图或其他类似 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.

如果您在设备上运行,则消息将为[MC] Reading from public effective user settings。如果您在 SIM 卡上运行,消息将是[MC] Reading from private effective user settings.

回答by Vinoth Vino

  • Go to Xcode -> Product -> Scheme -> Edit Scheme
  • In the Environment Variables, add OS_ACTIVITY_MODEas name and disableas value.
  • Xcode -> Product -> Scheme -> Edit Scheme
  • 在 中Environment Variables,添加OS_ACTIVITY_MODE为名称和disable值。

screenshot

截屏

I hope this helps you.

我希望这可以帮助你。

回答by Tony

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.

Xcode 似乎充满了这些令人困惑和误导性的警告。当我在 UITextField 中输入文本时会出现此警告,起初我认为我的代码有问题。

回答by Flipper

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

您在控制台中的下一个输出是这样的:[access] <private>. 我收到了您的警告,我的 plist 文件中缺少相机使用权限Privacy - Camera Usage Description。您需要在 plist 中的隐私说明您使用的隐私:Contacts, Calendar, Reminders, Photos, Bluetooth Sharing, Microphone, Camera, Location, Health, HomeKit, Media Library, Motion, CallKit, Speech Recognition, SiriKit, TV Provider

回答by Airel

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!

我在触摸显示警报的 Bar 按钮时遇到了同样的问题,该按钮又具有一个 TextField。我使用此链接中评论的提案以任何方式解决了这个问题。它至少对我有用!问候!

回答by gersonmontenegro

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.

我在 iPhone5 模拟器中遇到了这个问题(在设备上一切正常),它在触摸 TextInput 后​​卡住了我的 Ionic 应用程序,然后我将模拟器更改为另一个模拟器,如 iPhone6 或 iPhone8,一切又恢复正常。