iOS弹出框的小问题

2016-07-27  本文已影响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];

解决了我的问题

});

上一篇下一篇

猜你喜欢

热点阅读