弹出窗口,阻止目标中的应用程序C

问题描述:

我想显示一个框并根据用户的输入继续执行我的代码。 UIAlertView不起作用,因为应用程序不会等待输入。那么是否有另一种类型的小部件可以等待用户输入,然后将控制权交给应用程序? 我知道这里有重复,但他们不是很有帮助,因为我似乎缺少一些片断(全新的目标c ...)弹出窗口,阻止目标中的应用程序C

+0

你想要什么exaclty? – Balu 2013-05-07 09:43:52

+0

想要显示用户输入数据的弹出窗口? – Balu 2013-05-07 09:46:49

+0

您是否尝试将textField置于警戒状态? – Stas 2013-05-07 09:51:22

-(void)function1{ 

... 
// Add UIAlertView *alert; to .h file 
alert = [[UIAlertView alloc] initWithTitle:@"" message:@"" delegate:self cancelButtonTitle:@"No" otherButtonTitles:@"Yes", nil]; 
[alert show]; 

} 

-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ 

if(alertView == alert && buttonIndex == 1){ // If yes 
[self function2]; 
} 
} 

-(void)function2{ 

... 
//Continue your task 

} 

您想要一个MODAL警报 - 只需使用UIAlertView并等待其在继续之前委托。