xcode “SecRandomCopyBytes”的类型冲突

w6mmgewl  于 2023-02-25  发布在  其他
关注(0)|答案(2)|浏览(126)

当我尝试归档新版本的应用程序时,xCode上出现错误,我无法确定它来自何处以及如何修复它。
看看xcode的打印屏幕:Screenshot

cigdeys3

cigdeys31#

iOS 11更改了该方法的签名。
你可以试试这个

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
extern int SecRandomCopyBytes(SecRandomRef rnd, size_t count, void *bytes) __attribute__((weak_import));
#else
extern int SecRandomCopyBytes(SecRandomRef rnd, size_t count, uint8_t *bytes) __attribute__((weak_import));
#endif

来源:https://github.com/RNCryptor/RNCryptor/issues/248

ztigrdn8

ztigrdn82#

这在macOS上很管用
替换为

extern int SecRandomCopyBytes(SecRandomRef rnd, size_t count, void * bytes) __attribute__((weak_import));

相关问题