break a loop if Esc was pressed

You’re currently making a command-line application which reads stuff from standard input and prints stuff to standard output. How buttons presses are handled depends entirely on the terminal in which your are running your program, and most terminals won’t send anything to your application’s stdin when escape is pressed. If you want to catch key … Read more

Loop background music? [closed]

You can use the AVAudioPlayer: NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@”mySound” ofType:@”mp3″]; NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath]; AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL error:nil]; player.numberOfLoops = -1; //infinite [player play]; and you can jump through by setting the currentTime: player.currentTime = 10; //jump to 10th second