Undefined symbols for i386 architecture: "_OBJC_CLASS _ $ _ SecIdentity"

Xcode will not allow me to compile this code:

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

The compiler exits with the following error:

 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) 

I checked a few things and saw that SecIdentity is a type alias. I found out that the compiler always generates these error messages when I try to apply something to a type alias. If I pass it to a class (e.g. NSObject / NSDictionary), it really works, but CFDictionary will also throw an error. Does it help?

+1
source share
1 answer

SecIdentity and friends are part of the Security Framework, so it seems that you need to relate to this.

+1
source

Source: https://habr.com/ru/post/970555/


All Articles