Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6692479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:52:21+00:00 2026-05-26T05:52:21+00:00

I’ve implemented a camera using the AVFoundation framework provided in iOS 4 & 5,

  • 0

I’ve implemented a camera using the AVFoundation framework provided in iOS 4 & 5, but have been experiencing an inconsistent issue with the captureStillImageAsynchronouslyFromConnection:completionHandler: function where the completion handler block is never called. The shutter sound does not fire and the preview freezes in this situation.

I’ve followed both Apple (WWDC 2010 & 2011 videos) and non-Apple guides (blog and SO posts) to implement a still image capture at Photo resolution with little to no improvement. I’ve been able to reproduce somewhat consistently under the following conditions:

  • If I set flash to AVCaptureFlashModeAuto and take a photo in low light, it hangs and never runs the completion block. The flash fires, but the shutter sound does not. With the same code I am able to take a photo at normal light where the shutter sound fires, flash does not, and completion block runs.
  • If I do not set the flashMode or set it to off, I am able to take some photos, but after a small number (between 1 and 5, usually) the completion block stops firing. For clarification, a scenario might be:
    1. Take a photo and view at confirmation screen
    2. Go back to take photo screen
    3. Repeat 1 & 2 a couple times
    4. Hit take a photo and it hangs before the completion block.

My Implementation

I have the interface handled in a ViewController and separate class to handle all the AVFoundation stuff. An instance variable of the separate class that handles the AVFoundation stuff is in the ViewController. It’s different than example implementations, but I don’t see why it should cause this kind of occasional bug.

More Observations

  • Even when checking [stillImageOutput isCapturingStillImage], it will continue to return false and continue to run the captureStillImageAsynchronouslyFromConnection function
  • If I switch to another application, lock the phone, take certain other actions in the application, or tap the ‘Take Photo’ button a million times I am able to get the completion block to return an error. They are different based on which action. Common ones are 11800, 11801, and 11830. They seem to be unrelated to the hang.
  • I’ve let our test phone (iPhone 4 GSM) sit for an hour to see if it would eventually process. No dice.

I would love to know if there’s something that I could be missing, a property left unset, or a known issue with a work around.

Thanks.

(I saw a similar post, but none of the answers solved my problem. I need Photo res in the application. For reference:
iPhone SDK 4 AVFoundation – How to use captureStillImageAsynchronouslyFromConnection correctly?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:52:22+00:00Added an answer on May 26, 2026 at 5:52 am

    I should have added code, it probably would have helped anyone viewing this, but anyway:

    It turns out that the camera Flash has a significant enough impact on the amount of time it takes to process the image to cause issues when capturing something asynchronously. I had accidentally ended the capture session before the notification was sent from the completionHandler block.

    - (void) saveImageFromCamera {
      [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(imageCapturedFromCamera) name:@"FTW_imageCaptured" object:nil];
    
      [cameraController captureStillImage];
      // WRONG: Session was stopped here before
    }
    
    - (void) imageCapturedFromCamera {
      [[NSNotificationCenter defaultCenter] removeObserver:self name:@"FTW_imageCaptured" object:nil];
    
      [sharedAppController setBackgroundImage:[cameraController stillImage]];
      sharedAppController.imageFromCamera = YES;
      [self endCamera];
      // CORRECT: Should have stopped session here
    
      [self updateBackgroundImage];
    }
    

    I hope this can help anyone else that runs into something like this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.