Make the AVAudioPlayer a property of the class so that it is not released when the function goes out of scope.
@property (strong, nonatomic) AVAudioPlayer* avPlayer;
Then initialize with
self.avPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:mp3File] error:NULL];