2

我在 iOS 中共享自定义 UIActivity 时遇到问题。

我有一个名为 avc 的 activityViewController,我在主控制器中这样称呼它:

[self presentViewController:avc animated:YES completion:^{[self animationCompleted];}];

然后我有我的 animationCompleted 功能:

-(void)animationCompleted{

//-- define the activity view completion handler
avc.completionHandler = ^(NSString *activityType, BOOL completed){

    if (completed) {
        if ([activityType isEqualToString: @"myType"]){

            otherController = [[OtherController alloc] init];
            [self presentModalViewController:otherController animated:YES];

        }
    } 
};

}

我遇到的问题是,当我尝试展示我的 otherController 时,我收到一条警告,告诉我我正在尝试展示 UIViewController 而另一个正在展示或关闭(我已经调试过,似乎 UIActivityViewController 没有被关闭)。

文档说在 UIActivityViewController 被解除时调用了completionHandler,那么为什么我会收到这个错误?

非常感谢。

4

0 回答 0