我正在使用
for (int i = 1, i<100, i++)
int i = arc4random() % array count;
Run Code Online (Sandbox Code Playgroud)
但我每次都会重复.如何int从范围中填写所选的值,以便在程序循环时我不会得到任何欺骗?
我想在我的应用程序上实现此功能,但我似乎无法弄清楚如何使用这行代码.
- (void)applicationWillResignActive:(UIApplication *)application {
//our app is going to loose focus since there is an incoming call
[self pauseGame];
}
- (void)applicationDidBecomeActive:(UIApplication *)application{
//the user declined the call and is returning to our app
[self resumeGame];
}
Run Code Online (Sandbox Code Playgroud)
我已经读过这个必须放在appdelegates但我似乎无法弄清楚当游戏当前在viewcontroller中时我怎么能调用我的暂停动作.
谢谢.