I am trying to play music in my application. The music works fine but after switching viewControllers and returning to the main menu, my music plays again! It means several
Initialize your player in app delegate file and play your background music. Only set one variable in app delegate which checks music play true or false...and enjoy your app without restarting music......
In your code you initialize you player in view did load and init method... that's why you music restart.....just call it only once in app delegate applicationdidfinshLaunching() method....