我让 AlertView 与“cancelButtonTitle:@"Cancel"”和“otherButtonTitles:nil”完美配合。我的问题是如何获得其他按钮。
当我只更改“otherButtonTitles:@"2nd Button"”时,iPhone 模拟器就会从应用程序中崩溃并进入主屏幕。
最佳答案
你想这样结束你的方法调用:
... cancelButtonTitle:@"Cancel"otherButtonTitles:@"Button1Title", @"Button2Title", nil];
这与您在字符串格式化中看到的模式相同,其中参数列表可以是任意长度。通常参数列表是 nil 终止的。不要忘记零。
关于iphone - 如何创建 "otherButtonTitles"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1955860/