views:

119

answers:

1

I have a camera application that uses my custom overlay on the UIImagePickerController object.

I am calling the takePicture method to take a picture when the user presses a button on my overlay view. Something like:

[imagePicker takePicture];
[self showProcessingIndicator];

The processing indicator is the usual spinning wheel that shows that a picture is being taken. I notice that often the camera does not take a picture immediately after the takePicture method is called, and the processing indicator is showing.

It seems that the camera tries to adjust its focus (if it is out of focus) and then takes a picture. This is probably the right thing to do. However, I have also noticed delay in taking a picture even when the camera is focused correctly and does not change its focus. This does not happen every time, and its hard to say when exactly it happens.

My question is: is there a way to force the camera to take a picture instantly, ignoring everything else? Also, is it possible that subsequent processing (showing the indicator view, for example) is causing the camera to respond slower on occasion?

Thanks!

A: 

I have also seen this and came to the conclusion that taking a picture is a reasonably resource-hungry operation in terms of talking to the camera device, allocating/moving memory, etc. While you can tune your application to not soak up any resources while this piece is running, you can't tell MobileMail, MobileiTunes, etc, to not check for email, etc, at that precise moment.

Is there any particular iOS version or device that this happens on more than others? Taking a picture on my iPhone 3G with iOS 4.0.x took up to 30 seconds, but is much improved on iPhone 4.

The activity indicator will soak up some resources, so this may be a candidate for removal and maybe just use sound instead. Test to be sure.

JBRWilkinson
Thanks! I did remove the activity indicator without any noticeable difference. I guess, we have to live with this for now.
AJJ