Create alertview to show
UIAlertView *dialog = [[UIAlertView alloc] initWithTitle:@"Please enter" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
[dialog setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput];
[[dialog textFieldAtIndex:1] setSecureTextEntry:NO];
[[dialog textFieldAtIndex:0] setPlaceholder:@"User Name"];
[[dialog textFieldAtIndex:1] setPlaceholder:@"Email Id"];
[dialog show];
This is the delegate method to catch the user input
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
[alertView dismissWithClickedButtonIndex:0 animated:YES];
if (buttonIndex == 0) {
//cancel clicked
}else {
NSString *name = [[alertView textFieldAtIndex:0].text stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceCharacterSet]];
NSString *email = [[alertView textFieldAtIndex:1].text stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceCharacterSet]];
}
}
Very informative post.I am really impressed by this incredible precious site .Nice blog! I loved reading through your blog.
ReplyDeletewish you good luck for your best efforts...
iPhone App Development :: && :: Mobile and Web Application Development
Smith, Please, accept my heartfelt thanks, for your invaluable moral support. This will surely become driving force for me...
ReplyDeleteThanks Again