sdf

- ( 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)