Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dbramhall

macrumors newbie
Original poster
Aug 1, 2011
16
0
England, UK
I was wondering how to implement an if statement that counts the amount of shakes and runs some code, see below...

Code:
if (SHAKECOUNTTHING == 1) { // First shake
NSLog(@"Shake 1");
}
else if (SHAKECOUNTTHING == 2) { // Second shake
NSLog(@"Shake 2");
}
else if (SHAKECOUNTTHING == 3) { // Third shake
NSLog(@"Shake 3");
}

I'm not sure how to go about this and what to swap SHAKECOUNTTHING with. Thanks a lot!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.