編集-私はこれを自分で解決しました-下部のメモを参照してください
Xcode 5 で iOS7 を使用している場合、カメラまたはフォト ライブラリから画像を取得するオプションを使用しています。
これは iOS7 を実行している iPhone では発生せず、iPad では問題なく動作しますが、方法は少し異なりますが、iOS7 では iPhone のみの問題のようです。
たとえば、ライブラリ関数から画像を選択する際に使用されるコードは次のとおりです。
-(void) choosePic {
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum]) {
UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
cameraUI.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
cameraUI.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType: UIImagePickerControllerSourceTypeSavedPhotosAlbum];
cameraUI.allowsEditing = NO;
cameraUI.delegate = self;
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
_popover = [[UIPopoverController alloc] initWithContentViewController:cameraUI];
[_popover presentPopoverFromRect:btnLibrary.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
else
[self presentModalViewController: cameraUI animated: YES];
}
}
また、ピッカーが終了したらコード。
- (void) imagePickerController: (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) info {
//Disable buttons
[[UIApplication sharedApplication] setStatusBarHidden:YES];
[self disableButtons];
//Get image
self.originalImage = (UIImage *) [info objectForKey: UIImagePickerControllerOriginalImage];
//Dismiss
if(_popover)
{
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
[_popover dismissPopoverAnimated:YES];
_popover = nil;
}
}
else
[picker dismissModalViewControllerAnimated: YES];
//Next
[self performSelector: @selector(nextScreen) withObject:nil afterDelay:0.5];
}
切り替えることでこれを修正しました。
[picker dismissModalViewControllerAnimated: YES];
と
[picker dismissViewControllerAnimated:NO completion:nil];