gpt4 book ai didi

ios - 我在 iOS8 中使用了 uialertview ,但是在我两次单击取消按钮后应用程序崩溃了

转载 作者:行者123 更新时间:2023-12-03 17:44:14 26 4
gpt4 key购买 nike

我在取消委托(delegate)方法中什么都不做。
我需要帮助。

我的代码:

- (void)back{
if(_stateView.stateType == StateType_Failed || _stateView.stateType == StateType_WiFi){
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"温馨提示" message:[NSString stringWithFormat:@"您确认要放弃连接 %@ 免费热点",_SSID] delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"不,谢谢", nil];
[alertView show];
return;
}
[self.navigationController popViewControllerAnimated:YES];

}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if(buttonIndex == 0){
[self.navigationController popViewControllerAnimated:YES];
}

}

我添加了一个断点并获得了崩溃日志和堆栈。
[_UIAlertControllerShimPresenterWindow becomeFirstResponder]: message sent to deallocated instance 0x15e752ec0

(lldb) bt

* thread #1: tid = 0x1c8de, 0x000000018359017c CoreFoundation`___forwarding___ + 968, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x18359017c)
* frame #0: 0x000000018359017c CoreFoundation`___forwarding___ + 968
frame #1: 0x0000000183492ccc CoreFoundation`_CF_forwarding_prep_0 + 92
frame #2: 0x00000001880ac704 UIKit`-[UIPeripheralHost(UIKitInternal) _restoreInputViewsWithId:animated:] + 356
frame #3: 0x00000001883ac834 UIKit`-[UIAlertController _restoreInputViewsAnimated:] + 128
frame #4: 0x00000001883ac5e0 UIKit`-[UIAlertController viewDidDisappear:] + 92
frame #5: 0x0000000187fe3f28 UIKit`-[UIViewController _setViewAppearState:isAnimating:] + 440
frame #6: 0x0000000187fe452c UIKit`-[UIViewController _endAppearanceTransition:] + 344
frame #7: 0x00000001882d2b58 UIKit`-[UIPresentationController transitionDidFinish:] + 984
frame #8: 0x00000001882d512c UIKit`__56-[UIPresentationController runTransitionForCurrentState]_block_invoke_2 + 168
frame #9: 0x00000001880eefd0 UIKit`-[_UIViewControllerTransitionContext completeTransition:] + 132
frame #10: 0x0000000188004774 UIKit`-[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 408

……
(代码太多,我不能全部发布。)

最佳答案

在 throw 上添加一个异常断点,并在调试时尝试重现它。并在这里发布一些代码,让我们看看有什么问题......

似乎您的 UIAlertControllerShimPresenterWindow 已被释放得太早......

关于ios - 我在 iOS8 中使用了 uialertview ,但是在我两次单击取消按钮后应用程序崩溃了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29819931/

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