I've been trying to get this code to work for the last 2 hours and though it showed no error on the simulator, there was one on the device.
Turns out, at least in my case that the error came from directory used (bundle) :
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/recordTest.caf", [[NSBundle mainBundle] resourcePath]]];
It was not writable or something like this... There was no error except the fact that prepareToRecord failed...
I therefore replaced it by :
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *recDir = [paths objectAtIndex:0];
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/recordTest.caf", recDir]]
It now Works like a Charm.
Hope this helps others.