gpt4 book ai didi

iOS/ cocoa : UIAlertView throwing EXC_BAD_ACCESS

转载 作者:行者123 更新时间:2023-11-28 18:25:01 24 4
gpt4 key购买 nike

似乎是一个令人震惊的微不足道的差异。将 otherButtonTitles 的非 nil 值传递给 UIAlerView 会爆炸。

工作:

UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Login with your credentials"
message:nil
delegate:nil
cancelButtonTitle:@"Cancel"
otherButtonTitles:nil];

不工作:

UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Login with your credentials"
message:nil
delegate:nil
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK"];

什么给了?

最佳答案

UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Login with your credentials"
message:nil
delegate:nil
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK1",@"OK2",nil];

最后一个参数是一个多参数,应该以 nil 结尾。

关于iOS/ cocoa : UIAlertView throwing EXC_BAD_ACCESS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11910539/

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