在我的 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 模拟器