objective c iphone musicplayer crashing
===

I am creating a non appstore jailbreak tweak and I came across a problem that causes my app to crash.

I am using ` musicPlayer = [MPMusicPlayerController iPodMusicPlayer];`

the music player has complete functionality, play/pause, next, previous. it displays the title of the song, the artist, the artwork and everything.

the problem seems to be the loading and unloading of the musicplayer.

for example, if i am running the app, and i close the iphone's Music app, it will cause my app to crash. also if i load the app without the Music app running in the background it will crash.

as long as the music app is running in the background my app will not crash.
can anyone help me with this?