[問題]可計算視窗出現的次數或按鈕按過的次數嗎

作者: 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