Ios uiActionSheet init在CCLayer中失败
环境:ios;iPad;cocos2d 我有一个cocos2d CCLayer派生类,在这个类中,我试图打开一个UIActionSheet来验证用户的“退出游戏”请求。打开UIActionSheet的代码如下:Ios uiActionSheet init在CCLayer中失败,ios,ipad,cocos2d-iphone,uiactionsheet,Ios,Ipad,Cocos2d Iphone,Uiactionsheet,环境:ios;iPad;cocos2d 我有一个cocos2d CCLayer派生类,在这个类中,我试图打开一个UIActionSheet来验证用户的“退出游戏”请求。打开UIActionSheet的代码如下: UIActionSheet *verifyQuit = [[UIActionSheet alloc] initWithTitle:@"Quit Game ?" delegat
UIActionSheet *verifyQuit = [[UIActionSheet alloc] initWithTitle:@"Quit Game ?"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:@"OK"
otherButtonTitle:nil];
[verifyQuit showInView:[UIApplication sharedApplication].keyWindow];
[verifyQuit release];
在init(示例中的第一行)上,我将错误记录到调试器控制台:
-[UIActionSheet initWithTitle:delegate:CancelButtonTile:DestructiveButtonTile:OtherButtonTile:]:发送到实例0x54cb10的无法识别的选择器
init永远不会返回,错误会反复记录,直到我从调试器停止程序。我不知道地址0x54cb10处的对象是什么-它不是我试图实例化UIActionSheet的CCLayer派生对象
你知道我在这里遇到了什么吗
谢谢 这只是你错过的一件小事
otherButtonTitle:nil
应该是
otherButtonTitles:nil
参数名末尾缺少一个s,因此编译器无法找到该方法。啊,现在我觉得自己很愚蠢。谢谢,伙计。我看了又看;我想我有隧道视力。