SecIdentity? { let dict = keychain-6ren">
gpt4 book ai didi

swift - 架构 i386 的 undefined symbol : "_OBJC_CLASS_$_SecIdentity"

转载 作者:行者123 更新时间:2023-11-28 07:18:13 25 4
gpt4 key购买 nike

Xcode 不允许我编译这段代码:

func getIdentity(keychainArray: NSArray) -> SecIdentity? {
let dict = keychainArray[0] as Dictionary<String,AnyObject>
let key = kSecImportItemIdentity.takeRetainedValue()
return dict[key] as SecIdentity?
}

编译器因以下错误而退出:

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SecIdentity", referenced from:
__TFC9messenger10Connection19streamOpenCompletedfS0_FT_T_ in Connection.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我测试了一些东西,发现 SecIdentity 是一个类型别名。我发现当我尝试将某些内容转换为类型别名时,编译器总是会生成这些错误消息。如果我将它转换为一个类(例如 NSObject/NSDictionary)它确实有效,但 CFDictionary 也会导致错误。这有帮助吗?

最佳答案

SecIdentity and friends是安全框架的一部分,因此听起来您需要链接到它。

关于swift - 架构 i386 的 undefined symbol : "_OBJC_CLASS_$_SecIdentity",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24122645/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com