ฉันมีรหัสต่อไปนี้เพื่อแสดงข้อความแสดงข้อผิดพลาดใน UIAlertController ใน IOS 13 มันทำงานได้อย่างสมบูรณ์แบบใน IOS 11 แต่ตอนนี้ฉันได้รับข้อผิดพลาดของคอนโซลดังต่อไปนี้ ใครช่วยกรุณาแนะนำวิธีการนี้สามารถแก้ไขได้ขอบคุณ
-(void)errorMessage
{
UIAlertController* alert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Information",information)
message:displaymessage
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK",ok)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {}];
[alert addAction:defaultAction];
[self presentViewController:alert animated:YES completion:nil];
}
ข้อผิดพลาด:
> 2020-04-18 00:19:07.958139+0100 TrigCalculator[9298:636378] Warning: > Attempt to present <UIAlertController: 0x7fa448043200> on > <UITabBarController: 0x7fa44b008200> which is already presenting > <UIAlertController: 0x7fa44787fc00>