NSExtension - 运行时警告 - [NSXPCDecoder validateAllowedClass:forKey:]

NSExtension - Runtime warning - [NSXPCDecoder validateAllowedClass:forKey:]

我正在使用共享扩展,但收到以下运行时警告:

注意:即使在新项目上添加共享扩展 运行 也会抛出相同的运行时警告

[Foundation] *** -[NSXPCDecoder validateAllowedClass:forKey:]: NSSecureCoding allowed classes list contains [NSObject class], which bypasses security by allowing any Objective-C class to be implicitly decoded. Consider reducing the scope of allowed classes during decoding by listing only the classes you expect to decode, or a more specific base class than NSObject. This will become an error in the future. Allowed class list: {(
    "'NSObject' (0x7fff862bc6e8) [/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib]"
)}

下面给出的是扩展的 info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NSExtension</key>
    <dict>
        <key>NSExtensionAttributes</key>
        <dict>
            <key>NSExtensionActivationRule</key>
            <dict>
                <key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
                <integer>1</integer>
            </dict>
        </dict>
        <key>NSExtensionMainStoryboard</key>
        <string>MainInterface</string>
        <key>NSExtensionPointIdentifier</key>
        <string>com.apple.share-services</string>
    </dict>
</dict>
</plist>

问题:

结论:

  • 我得到 Apple 的官方确认,这是他们在使用共享功能时出现的错误
  • 我已提交错误报告并已将反馈 ID 告知他们。
  • 有人告诉我,只要我的应用程序没有发现任何问题,我就可以忽略该错误。