[问题]可计算视窗出现的次数或按钮按过的次数吗

楼主: ljuyentintho (小刘)   2015-03-03 22:32:21
目前警告视窗出现的次数是用这个方法
if (StartGame.hidden==YES) {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Moving Stopped"
message:@"Finger has been lifted off the screen."
delegate:nil cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alert show];
}
有办法可以算出目前警告视窗出现了几次吗?
还是有办法计算button按过的次数呢?
谢谢各位大大
作者: Esvent (Esvent)   2015-03-03 22:48:00
设个变量 每次执行到这边就++一次?
作者: kidd0717 (momoyo)   2015-03-03 23:58:00
或是alertview有delegate 在那边去计算按钮按了几次也可
作者: BS0824 (Bright_Sky)   2015-03-04 08:43:00
static会是你的好选择

Links booklink

Contact Us: admin [ a t ] ucptt.com