0
我正在使用以下代码来显示警报控制器,但有时它会收到上述消息并且警报控制器会停止响应。这是什么意思?固定?尝试在*上呈现*(已存在)(空)
+(void)showAlertFor:(UIViewController *)viewController Title:(NSString*)title WithMessage:(NSString *)message
{
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Error" message:message preferredStyle:UIAlertControllerStyleAlert]; //Getting the alert view controller
UIAlertAction* ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
}];
[alertController addAction:ok];
[viewController presentViewController:alertController animated:YES completion:nil];
}
检查您是否提供多个控制器。 –
这可以怎么做? – TestShroff
@TestShroff你可以从同一个地方的两个地方调用'showAlertFor'吗?或者同时解雇VC? – PiyushRathi