-1

I'm creating a project which requires the user to be able to set a sound to play at a specific time and I'm currently doing that with local notification. I would like to change that to use AVAudioPlayer, and I was wondering, what would be the best approach?

The objects I've got at the moment are a NSDatePicker and a stringFromDate string. My aim is to create an alarm so that the user can set a time using the NSDatePicker and at that time the sound will go off.

William Barbosa
  • 4,936
  • 2
  • 19
  • 37
crazy_tiger_corp
  • 271
  • 3
  • 22

1 Answers1

-1

Please use Global variable or Class variable to play the alarm.

@property AVAudioPlayer * player;

... ...

_player = [AVAudioPlayer alloc]...
[_player play];

It'll works fine for your project.

Richard
  • 109
  • 5