KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I think I'm going insane. "counter" and "interval" are both doubles. This is happening on accelerometer:didAccelerate at an interval of (.01) . "counter" should eventually increment to "interval". For some reason i cant get this "if" to ring true. Am I overlooking something? double interval = .5; if( counter == interval ){ //should eventually be .50000 == .50000 NSLog( @"Hit!" ); [self playSound]; counter = 0; }else{ counter += .01; } NSLog( @"%f, %f, %d",counter,interval,(counter == interval) );
Tags (comma-separated)
Save Edits
Cancel