Reputation: 9705
In the code here, I am able to record audio and also play it back successfully no problem there.
Problem is that audioRecorderDidFinishRecording
is never getting called. What am I missing?
func audioRecorderDidFinishRecording(recorder: AVAudioRecorder!, successfully flag: Bool) {
println("Recording finished")
}
Upvotes: 1
Views: 1363
Reputation: 196
You are assigning self to delegate even before it is created
audioRecorder?.delegate = self
audioPlayer?.delegate = self
prepareForRecording()
audioRecorder
is created in prepareForRecording()
function, audioRecorder
is nil before that.
Assign self to delegate after it is created.
Upvotes: 1