0
我想使用XMPP框架發送和接收消息。我使用XMPPStream類來發送和接收消息。我的代碼,以接收信息是Iphone鐺錯誤
- (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message {
NSString *msg = [[message elementForName:@"body"] stringValue];
NSString *from = [[message attributeForName:@"from"] stringValue];
NSMutableDictionary *m = [[NSMutableDictionary alloc] init];
[m setObject:msg forKey:@"msg"];
[m setObject:from forKey:@"sender"];
[_messageDelegate newMessageReceived:m];
[m release];
}
當我建立我得到一個鏈接錯誤
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_XMPPStream", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_XMPPPresence", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
請指引我來解決這個問題。
在此先感謝。
與clang無關。你正在使用可可的XMPP框架(看來),而不是添加框架。見https://github.com/robbiehanson/XMPPFramework/wiki/GettingStarted_iOS – Jano 2012-03-06 05:23:15
但是我已經在我的項目中添加了可可的XMPP框架,就像在那個鏈接中說的那樣。我錯過了一些東西,請指導我解決這個問題。 – Harry 2012-03-06 05:32:29
您是否已將所有XMPP源文件添加到您的項目中?他們會有像'XMPPStream.m'這樣的名字。還是你添加一個靜態庫到你的項目?它會有一個像'libXMPP.a'或'libXMPPFramework.a'這樣的名字。 – 2012-03-06 05:42:32