何らかの理由で、アプリでカメラ内モードを初めて開いたときにUIImagePickerController
空白になります。カメラ フィードを機能させるには、そのビューを閉じてから再度開く必要があります。私は、iOS 6 でカメラ キャプチャに完全に機能する標準コードを使用しています。以下のサンプルから、capturePhoto:
メソッドを起動しています。iOS 7 のカメラでこの問題に遭遇した人は他にいますか? Apple dev フォーラムをチェックしましたが、そこで回答を見つけることはほぼ不可能です。
- (IBAction)capturePhoto:(id)sender {
[self doImagePickerForType:UIImagePickerControllerSourceTypeCamera];
}
- (void)doImagePickerForType:(UIImagePickerControllerSourceType)type {
if (!_imagePicker) {
_imagePicker = [[UIImagePickerController alloc] init];
_imagePicker.mediaTypes = @[(NSString*)kUTTypeImage];
_imagePicker.delegate = self;
}
_imagePicker.sourceType = type;
[self presentViewController:_imagePicker animated:YES completion:nil];
}