- (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message
{
ChatViewController *chatView;
if(contactView==nil)
{
chatView=[[ChatViewController alloc] initWithNibName:@"ChatViewController" bundle:nil];
}
[self.navigationController pushViewController:chatView animated:YES];
[messageDelegate newMessageReceived:m];
}
上面的委托方法为每个传入的消息调用。当它调用时,它会转到一个新的 UIViewController。我的问题是一个视图推送了多个 tinmes,所以会发生错误。我该如何在 iphone 中修复这个错误