パケットの受信を担当する Packet というクラスがあります。このクラス内で、View Controller を変更したいのですが、現在の View Controller は次のとおり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];