This happens, because by default your application is using AVAudioSessionCategorySoloAmbient audio session category.
You could disable auto-lock, but that would decrease battery life. Might be better to continue music playing, regardless of auto-lock:
#import <AVFoundation/AVFoundation.h>Now your application works in same as iPhone music player (iPod). Please read more technical info about Audio Session Programming at Apple iOS Reference Library.
AVAudioSession *session = [AVAudioSession sharedInstance];
[session setCategory:AVAudioSessionCategoryPlayback error:NULL];