I solved this issue but not sure it's perfect or not so if you find another one then please tell me here.
i did change in
-(void)xmppStream:(XMPPStream *)sender didNotAuthenticate:(DDXMLElement *)error
{
NSLog(@"didNotAuthenticate Method");
if(isRegister == TRUE)
{
[xmppStream registerWithPassword:_myTextViewCustom.text error:nil];
NSError * err = nil;
if(![xmppStream registerWithPassword:_myTextViewCustom.text error:&err])
{
NSLog(@"Error registering: %@", err);
[self performSelector:@selector(connect1) withObject:nil afterDelay:2.0];
}
}
}
-(void)connect1
{
isOpen = YES;
NSError *error = nil;
[xmppStream authenticateWithPassword:_myTextViewCustom.text error:&error];
}
I am calling Authentication again and it works but i don't think it's the final solution.