gpt4 book ai didi

ios - 点击警报按钮时,应用程序崩溃并显示以下崩溃日志

转载 作者:行者123 更新时间:2023-11-29 13:03:10 26 4
gpt4 key购买 nike

在我们的项目中,当点击警报 View 的按钮时,应用程序崩溃并显示以下崩溃日志。

示例代码:

 UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Room has been checked out.  Please contact Front desk." delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alertView show];



- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"TestNotification" object:nil];
}

崩溃日志:

Date/Time:       2013-10-10 17:51:11.390 +0530
OS Version: iOS 6.1.3 (10B329)
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x62694c37
Crashed Thread: 0

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x3b8455b0 objc_msgSend + 16
1 UIKit 0x357abe7c -[UIWindow firstResponder] + 64
2 UIKit 0x3581966c -[UIWindow _makeKeyWindowIgnoringOldKeyWindow:] + 300
3 UIKit 0x357be2b0 -[UIResponder resignFirstResponder] + 384
4 UIKit 0x358ff71a -[UIAlertView(Private) resignFirstResponder] + 38
5 UIKit 0x358ff292 -[UIAlertView(Private) _performPopoutAnimationAnimated:coveredBySpringBoardAlert:] + 434
6 UIKit 0x358920c0 -[UIApplication sendAction:to:from:forEvent:] + 68
7 UIKit 0x35892072 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26
8 UIKit 0x35892050 -[UIControl sendAction:to:forEvent:] + 40
9 UIKit 0x35891906 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 498
10 UIKit 0x35891dfc -[UIControl touchesEnded:withEvent:] + 484
11 UIKit 0x357ba5ec -[UIWindow _sendTouchesForEvent:] + 520
12 UIKit 0x357a77fc -[UIApplication sendEvent:] + 376
13 UIKit 0x357a7116 _UIApplicationHandleEvent + 6150
....

xcode 控制台异常:

2013-10-10 18:34:05.910 MyProject[1423:907] -[OS_dispatch_queue _windowBecameKey]: unrecognized selector sent to instance 0x1dd8ac10

最佳答案

这通常发生在您分配了一个选择器(在本例中为警报)但传递给选择器的方法不存在时,请检查您是否未将其用作目标“self”,确保该方法是公共(public)的或者,如果您使用该方法存在的目标“self”

关于ios - 点击警报按钮时,应用程序崩溃并显示以下崩溃日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19296366/

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