首页 > 其他 > 详细

sdf

时间:2015-03-30 13:30:01      阅读:203      评论:0      收藏:0      [点我收藏+]
- ( void )connect {
     if  (self.xmppStream == nil) {
         self.xmppStream = [[XMPPStream alloc] init];
         [self.xmppStream addDelegate:self delegateQueue:dispatch_get_main_queue()];
     }
     if  (![self.xmppStream isConnected]) {
         NSString *username = [[NSUserDefaults standardUserDefaults] objectForKey:@ "username" ];
         XMPPJID *jid = [XMPPJID jidWithUser:username domain:@ "lizhen"  resource:@ "Ework" ];
         [self.xmppStream setMyJID:jid];
         [self.xmppStream setHostName:@ "10.4.125.113" ];
         NSError *error = nil;
         if  (![self.xmppStream connect:&error]) {
             NSLog(@ "Connect Error: %@" , [[error userInfo] description]);
         }
     }
}


sdf

原文:http://my.oschina.net/stane/blog/393483

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!