一.什么是XMPP
XMPP是一种基于XML的即时通信协议,前身是jabber.
二.为何要写XMPP单例
因为XMPPStream是基于myJID创建的长链接,所以在应用程序中应该仅被实例化一次(也就是创建单例)
+ (id)shareInstance
{
static id _s;
if (_s== nil) {
_s = [[[self class]alloc]init];
}
return _s;
}
XMPP
须要添加的库
在xcode5.0须要加入systemConfiguration库防止SCnetWork错误,5.1版本则不须要
libXml2 添加头文件搜索路径$(SDKROOT)/usr/include/libxml2
libresolv
CFNetWork
Security
XMPP采用arc编译,若是工程是MRC,请进行标记-fobjc-arc
设置完请编译一下无错后,在进行下一步xcode