UIImagePickerController相机堆栈应用程序

时间:2013-12-04 10:45:43

标签: ios uiimagepickercontroller

我在我的应用中使用相机, 问题是应用程序工作太慢,因为相机进来了。 即使在我对相机解散之后,应用程序的其余部分也会变慢。 像相机一样的锁仍然可以在后台运行。 有没有办法完全停止相机?

这是我的代码:

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
        picker.sourceType = UIImagePickerControllerSourceTypeCamera;
        picker.delegate = self;
        [self presentViewController:picker animated:YES completion:Nil];

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
    NSLog(@"imagePickerControllerDidCancel");
    [picker dismissViewControllerAnimated:YES completion:NULL];
    [picker resignFirstResponder];
}

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    NSLog(@"didFinishPickingMediaWithInfo");
    [picker dismissViewControllerAnimated:YES completion:Nil];
    [picker resignFirstResponder];
    UIImage* image=[info objectForKey:@"UIImagePickerControllerOriginalImage"];
    UIImage* resizeImage = [self fixOrientation:image];
}

thanx寻求帮助! :)

1 个答案:

答案 0 :(得分:5)

在导航窗格中,您可以检查您的线程正在消耗内存。专注于此。