我有一个名为 Packet 的类,它负责接收数据包。在这个类里面我想改变视图控制器当前的视图控制器是:JoinViewController
。类定义为
@interface Packet : NSObject
我已经尝试了以下代码,但它在这里不起作用是代码:
case PacketTypeMytype:
{
GameViewController *gameViewController = [[GameViewController alloc] initWithNibName:@"GameViewController" bundle:nil];
JoinViewController *join=[[JoinViewController alloc]initWithNibName:@"JoinViewController" bundle:nil];
[[join navigationController]pushViewController:gameViewController animated:YES];