I'm very new at Objective C and developing for the iPhone so I apologize if this is an easy answer I've tried searching Google for going on 3 days now and bought iPhone Development for Dummies and no luck on something like this.
Essentially what I would like to do is play a sound when a button is pressed and then I would like to add 1 to the value of the audio file. So for example
//Play audio file (y.wav) ---y being the variable I would like to set.
if (y > 13) { ---there are a total of 14 sounds starting with file 0.wav going to 13.wav.
y = 0; ---so if the value is greater than 13 I want to start the cycle over with y equaling 0.
} else {
y++; ---if y is not greater than 13 I want to add one to it so it plays the next sound file next time.
}
I do have a some history with JavaScript so this example reflects JavaScript more than Objective-C. The app is similar to iFart but before you get on my case about not making another farting/burping application that's not actually what I am making it is just a similar concept for this portion of my app. So if someone could help me learn how translate this into Objective-C or maybe an entirely different method of reaching my goal I would greatly appreciate it.
Thanks, Joey