本文介绍了运行时警告CLSUserDefaults实施了两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

当在cocoapod源中使用#import语法时,我看到了与以下类似的警告,关于Pod定义的类的警告,但这是内部的Apple类定义(CLSUserDefaults),我无法控制并且也没有子类化.

I have seen a similar warning to that below for a pod-defined class when using #import syntax in cocoapod sources, but this is an internal apple class definition (CLSUserDefaults) which I have no control over and am not subclassing.

我不知道这是否真的引起了问题,但是这不应该发生.

I don't know if this is really causing a problem, but it shouldn't be happening.

objc[22040]: Class CLSUserDefaults is implemented in both
/System/Library/PrivateFrameworks/ClassKit.framework/Versions/A/ClassKit (0x7fff9932d2c0) and

/Users/devusrid1/Library/Developer/Xcode/DerivedData/MyApp-cdokjmhxdrnhuodmhtibejxyqmqt/Build/Products/Debug/USR ID MyApp.app/Contents/MacOS/My App (0x10057f340).

One of the two will be used. Which one is undefined.

我正在使用Xcode 11

I'm using Xcode 11

推荐答案

Fabirc(或Crashlytics,取决于所使用的版本)定义了名为CLSUserDefaults的类.

Fabirc (or Crashlytics, depending on which versions used) defines a class named CLSUserDefaults.

iOS 13中的ClassKit似乎也定义了一个CLSUserDefaults类,这会导致名称冲突.

It seems that ClassKit in iOS 13 also defines a CLSUserDefaults class, which leads to a name collision.

只要您的应用代码不直接使用类CLSUserDefaults,就可以了.

It should be fine as long as your app's code not using class CLSUserDefaults directly.

这篇关于运行时警告CLSUserDefaults实施了两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-08 03:37