Home > Software engineering >  AV Foundation: Cannot Find Error Code Reference
AV Foundation: Cannot Find Error Code Reference

Time:05-26

I'm working on an iOS camera application that takes photos on a timer. It seems to work well for about a minute and then it will intermittently fail to capture photos. I pick up this error in the didFinishProcessingPhoto portion of AVFoundation's Photo Capture Delegate:

Error Domain=AVFoundationErrorDomain Code=-11830 "Cannot Take Photo" UserInfo={AVErrorRecordingFailureDomainKey=3, NSLocalizedDescription=Cannot Take Photo, NSLocalizedRecoverySuggestion=Try taking a photo again.}

Does anyone know where I can find a reference to this error? I can't find Code=-11830 anywhere and there has to be something more descriptive than just "Cannot Take Photo".

CodePudding user response:

Sometimes this kind of error occur due to phone storage related issues, please check if your phone has enough memory also try again with app relaunch or phone restart.

CodePudding user response:

-11830 is AVErrorMaximumStillImageCaptureRequestsExceeded, which is actually documented (!!!)

Your app can’t take a photo because there are too many unfinished photo capture requests.

Are you deliberately taking many photos at once? If so check out AVCaptureVideoDataOutput and AVCaptureMovieFileOutput. These allow higher framerate video capture. Note that the formats are different to photo style presets.

  • Related