gpt4 book ai didi

objective-c - XMPP 不适用于 iOS 4.3 项目

转载 作者:太空狗 更新时间:2023-10-30 03:55:21 24 4
gpt4 key购买 nike

在我的 Xcode 项目中,我集成了 XMPP 框架。它在 iOS 5.1 模拟器上运行良好。当我尝试在 iOS 4.3 模拟器上运行该项目时,出现以下错误:

dyld: lazy symbol binding failed: Symbol not found: _objc_storeStrong
Referenced from: /Users/admin/Library/Application Support/iPhone Simulator/4.3.2/Applications/67451DE6-EFC1-4313-9A29-C2C641F727C6/AppName.app/AppName
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Foundation

dyld: Symbol not found: _objc_storeStrong
Referenced from: /Users/admin/Library/Application Support/iPhone Simulator/4.3.2/Applications/67451DE6-EFC1-4313-9A29-C2C641F727C6/AppName.app/AppName
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Foundation

错误发生在以下代码行:xmppStream = [[XMPPStream alloc] init];

进一步调试后发现错误出现在这里:

- (id)init
{
if ((self = [super init])) //**CRASH WHEN EXECUTING THIS STATEMENT
{
// Common initialization
[self commonInit];

// Initialize socket
asyncSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:xmppQueue];
}
return self;
}


我集成XMPP的项目不是ARC。因此,我针对所有 XMPP 文件添加了 -fobjc-arc。 XMPP 库提供的示例项目在 iOS 4.3 模拟器上运行良好。谁能帮我解决这个错误?
Xcode 版本:4.3.3
iOS:iOS 4.3 模拟器

最佳答案

如果 XMPP 需要 ARC 而您明确将其关闭,则会发生这种链接器错误。尝试从 XMPP 文件中删除 -fno-objc-arc 并在项目的其他链接器标志中添加 -fobjc-arcMore info

关于objective-c - XMPP 不适用于 iOS 4.3 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13027838/

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