1

I have an app with music , you can play music in 2 methods -> click on cell and another view controller is opening or click on a button and the music is playing .

How can i do that only one sound to be playing ?

I was trying this : [musicViewContreoller.player stop]. I synthesize player. but is not working . any ideea ?

Adina Marin
  • 663
  • 1
  • 4
  • 15

2 Answers2

1

u can crate singleton audio class with init method and methods for stop\play\pause etc.

can look this thread or this

hope this help

Community
  • 1
  • 1
0

I solved this by making the player a propetry in AppDelegate and then i use this :

AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
[appDelegate.player stop];
Adina Marin
  • 663
  • 1
  • 4
  • 15