草庐IT

clickedButtonAtIndex

全部标签

iphone - 导航标题/项目在操作表 clickedButtonAtIndex 中切换选项卡栏项目时消失?

我真的为这个而烦恼。我在我的第一个选项卡栏项中的第一个ViewController上显示一个操作表,当我点击确定时,我正在切换到另一个选项卡栏项中的另一个View,使用以下代码。-(void)actionSheet:(UIActionSheet*)actionSheetclickedButtonAtIndex:(NSInteger)buttonIndex{self.tabBarController.selectedIndex=1;}(我将ViewController分配给导航Controller,然后分配给我的应用委托(delegate)中的选项卡,对每个选项卡重复该过程)。从第二个选

objective-c - UIAlertView clickedButtonAtIndex 未被调用

这就是我创建警报的方式:UIAlertView*dialog=[[UIAlertViewalloc]init];dialog.delegate=self;//someoptionsaField=[[UITextFieldalloc]initWithFrame:CGRectMake(20.0,45.0,245.0,25.0)];[aFieldsetBackgroundColor:[UIColorwhiteColor]];[dialogaddSubview:appkeyField];[dialogshow];[aFieldrelease];但是-(void)alertView:(UIAle

iphone - appdelegate 中的 clickedButtonAtIndex 未被调用

我在MyapplicationAppDelegate.m文件中使用2个按钮“取消”和“确定”调用UIAlert,调用警报但点击“取消”或“确定”按钮-(void)alertView:(UIAlertView*)alertViewclickedButtonAtIndex:(NSInteger)buttonIndex方法未被调用。我在MyapplicationAppDelegate.h文件中添加了UIAlertViewDelegate,如下所示#importUIKit/UIKit.h@interfaceMyapplicationAppDelegate:NSObjectUIApplicati

ios - UIAlertViewDelegate :clickedButtonAtIndex and two buttons

小伙伴们:在我的测试应用程序的viewController中有两个按钮,我称之为“否”的正确按钮,另一个是"is"。两个按钮会调用两个不同的函数,而当用户按下其中一个按钮,我想向用户显示一个警告以确认这一点。我知道使用UIAlertViewDelegate-(void)alertView:(UIAlertView*)actionSheetclickedButtonAtIndex:(NSInteger)buttonIndex但是有两个按钮,我很纳闷。我怎么知道按下了哪个按钮。所以,请帮我解决这个问题,在此先感谢您! 最佳答案 当你创建