我对 iOS 的 XMPP 框架有疑问。每次我触发registerWithPassword
方法时,我都会得到一个错误:
"Error Domain=XMPPStreamErrorDomain Code=1 "请等待流连接。" UserInfo=0xad7c300 {NSLocalizedDescription=请等待流连接。} "
我在我的代码中执行以下步骤:
-(void)createUserWithUsername:(NSString*)name andPW:(NSString*)pw{
[self setupStream];
NSLog(@"name: %@ ",name);
NSString *nameFor = name;
[self disconnect];
NSString *jidBenutzer = [NSString stringWithFormat:@"%@@my-Server.com",nameFor];
NSError *error = nil;
NSError * err = nil;
NSLog(@"jabberid : %@",jidBenutzer);
XMPPJID *jid = [XMPPJID jidWithString:jidBenutzer];
self.xmppStream.myJID = jid;
[[self xmppStream] registerWithPassword:pw error:&err];
NSLog(@"Connection: %@",error);
NSLog(@"Register: %@",err);
}
我希望你能帮帮我 !