从另一个视图调用类

时间:2021-08-31 16:44:51

I am doing a game in iphone, suppose to change menu view to the game on touch single player. when the view change only the interface is shown but everything is not moving. i am suspecting that my codes only manage to call the view but not the game class. Is there anything i can call with other codes that anyone can help?

我正在用iphone做一个游戏,假设把菜单视图换成了touch单玩家游戏。当视图更改时,只显示接口,但所有内容都没有移动。我怀疑我的代码只能调用视图而不能调用游戏类。有什么东西我可以用其他代码打电话,任何人都可以帮忙吗?

-(IBAction) displayView;{ secondViewController = [[SecondViewController alloc] initWithNibName:@"SecondView" bundle:nil]; [self.view addSubview:secondViewController.view];

-(IBAction) displayView;{secondViewController = [[[secondViewController alloc] initWithNibName:@"SecondView" bundle:nil];(自我。视图addSubview secondViewController.view):;

    NSLog(@"PLAY");

}

}

This is the code that i currently using which only call the interface whereby secondViewController is the game class.

这是我目前使用的代码,它只调用了secondViewController是游戏类的接口。

1 个解决方案

#1


0  

If you want to know if your code is being called, the easiest way to check is place a breakpoint there and see if it gets hit when you "Build & Debug".

如果您想知道您的代码是否正在被调用,最简单的检查方法是在那里放置一个断点,并在“构建和调试”时查看它是否被击中。

#1


0  

If you want to know if your code is being called, the easiest way to check is place a breakpoint there and see if it gets hit when you "Build & Debug".

如果您想知道您的代码是否正在被调用,最简单的检查方法是在那里放置一个断点,并在“构建和调试”时查看它是否被击中。