I want to show a box and proceed with my code based on user's input. UIAlertView does not work as the application does not wait for the input. So is there another type of widget that can wait for user input and then pass control to the app ? I know there are duplicates here but they are not very helpful as I seem to be missing some pieces (completely new to objective c...)
Asked
Active
Viewed 959 times
1
-
what you want exaclty? – Balu May 07 '13 at 09:43
-
you want to show popup for user inputting data ? – Balu May 07 '13 at 09:46
-
Did you try to put a textField onto alert? – Stas May 07 '13 at 09:51
-
Just two buttons Accept/Decline. – user1845360 May 07 '13 at 09:58
-
http://stackoverflow.com/questions/16230700/display-uiviewcontroller-as-popup-in-iphone – CRDave May 07 '13 at 09:59
2 Answers
1
you want a MODAL alert -- just use a UIAlertView and wait for its delegate before proceeding.
- a {
alert.delegate = self;
[alert show];
}
-alertView:(id)a didDismissWithButtonIndex:(int)i {
[self proceed];
}
- proceed {
... after alert ...
}

Daij-Djan
- 49,552
- 17
- 113
- 135
1
-(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
}

Mohith
- 96
- 5