ios4 - UIImagePickerController : ignoring request to take picture; camera is not yet ready

标签 ios4 camera

我在我的应用程序中使用相机。

我想在 3 秒后自动拍照。
该代码在一种情况下工作得非常好接受..

如果应用程序进入后台,而相机滴答正在以任何方式进行,例如如果调用介于两者之间或用户按下主页键......那么当应用程序恢复时,它不会继续相机滴答并且在控制台中它会发出此警告

UIImagePickerController:忽略拍照请求;相机还没有准备好。

发生这种情况时我想重新启动相机
我该怎么办?

最佳答案

我们可以使用这些应用程序委托(delegate)功能

- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

关于ios4 - UIImagePickerController : ignoring request to take picture; camera is not yet ready,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7468632/

相关文章:

android - 删除 phonegap 中的缓存图像

iphone - 获取iphone照片库的图像名称

ios - 是否有任何免费的新闻提要 api 可用于显示新闻?

iphone - 使用CATransform3D创建翻转动画

ios - 在 iOS 上,如何延迟 cameraIris 动画的打开部分

swift - 如何将相机按钮添加到 UIImageView

iPhone : camera autofocus observer?

objective-c - 在 iPhone Xcode 3.2.5、iOS 4.2.1 中分配和释放内存

iphone - CorePlot 去除条形阴影效果

iOS Custom UIImagePickerController Camera Crop to circle - 在预览 View 中