gpt4 book ai didi

ios7 - UIAlertView 使程序崩溃

转载 作者:行者123 更新时间:2023-12-04 16:27:24 27 4
gpt4 key购买 nike

我遇到了崩溃:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIKeyboardTaskQueue performTask:] may only be called from the main thread.'

我 2 天都找不到解决方案。
这是代码:
[alert dismissWithClickedButtonIndex:0 animated:YES];
UIAlertView *noTicketAlert = [[UIAlertView alloc] initWithTitle:@"Aradığınız kriterlere uygun bilet bulunamadı!" message:nil delegate:self cancelButtonTitle:@"Tamam" otherButtonTitles: nil];
[noTicketAlert show];

最佳答案

我通过尝试显示来自后台线程的警报触发了此错误。固定如下:

dispatch_async(dispatch_get_main_queue(), ^{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:...
[alertView show];
});

关于ios7 - UIAlertView 使程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19005463/

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