apache/incubator-cordova-ios — pull request #60 by cpojer (2012-10-18 01:34:20+00:00)
Title: [CB-1669] Issue an error when media.startRecord() is failing.

See https://issues.apache.org/jira/browse/CB-1669 for reference.

This change returns an error if the recording cannot be successfully started.

According to the documentation AVAudioRecorder.record returns a boolean whether the recording was actually started properly or not ( https://developer.apple.com/library/mac/#documentation/AVFoundation/Reference/AVAudioRecorder_ClassReference/Reference/Reference.html ).

Note: I have not been able to reproduce the exact bug in CB-1669. I have used invalid recording settings and I was able to reproduce the same behavior (title bar turns red, similar errors in the device log). With this fix, the web app will be informed of recording issues before stopRecord is being called.

I haven't written a lot of Obj-C so far, please feel free to comment on my code and let me know of any other changes that are required for this to go in.