在My 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模拟器
答案 0 :(得分:0)
如果XMPP需要ARC并且您明确地将其关闭,则会发生此类链接器错误。
尝试从XMPP文件中删除-fno-objc-arc
,并在项目的其他链接器标志中添加-fobjc-arc
。 More info