gpt4 book ai didi

iphone - 警告 : Attempt to present on while a presentation is in progress

转载 作者:行者123 更新时间:2023-12-03 20:27:36 29 4
gpt4 key购买 nike

我正在使用 xcode 4.5.2 并为相机按钮创建了自己的 OverlayViewController。

现在,当我的委托(delegate) Controller - TakePhotoViewController 从 OverlayViewController 检索 didFinishWithCamera 操作时,我想将用户转移到 AdjustPhotoViewController。

但是,我收到以下警告,并且它没有被传输:

Warning: Attempt to present on while a presentation is in progress!

- (void)didFinishWithCamera
{
[[self.overlayViewController.imagePickerController presentingViewController] dismissViewControllerAnimated:YES completion:nil];
[self performSegueWithIdentifier:@"fromTakeToAdjust" sender:self];
}

最佳答案

实际上,根据我的经验,这与从同一个按钮调用 Segue 和 IBAction(调用 Segue)有关 - 检查 Interface Builder 中的连接检查器,看看您的按钮是否已连接到两者。

在你的 Storyboard中,它可能看起来像这样:

enter image description here

在您的代码中,它可能如下所示:

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if([segue.identifier isEqualToString:@"pushToNewVC"]) {
UIViewController *controller = (UIViewController *)segue.destinationViewController;
}
}

=

- (IBAction)launchNew VC:(id)sender {
[self performSegueWithIdentifier:@"pushToNewVC" sender:sender];
}

关于iphone - 警告 : Attempt to present <AdjustPhotoViewController> on <TakePhotoViewController> while a presentation is in progress,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13899563/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com