美文网首页
iOS弹出框的小问题

iOS弹出框的小问题

作者: 长风破浪初学者 | 来源:发表于2016-07-27 21:20 被阅读0次

Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior ()

我遇见的问题即是UIAlertController事件没加到控制器上,改为[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alertVC animated:YES completion:nil];又遇见

'-[UIKeyboardTaskQueue waitUntilAllTasksAreFinished] may only be called from the main thread.'

再接着把这个加到主线程中,dispatch_async(dispatch_get_main_queue(), ^{

[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alertVC animated:YES completion:nil];

解决了我的问题

});

相关文章

网友评论

      本文标题:iOS弹出框的小问题

      本文链接:https://www.haomeiwen.com/subject/dcgojttx.html