What is correct way to turn off dismiss UIAlertView when click button in UIAlertView. I want to check if not have string in UITextField when click button not dismiss the view.
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
//Add alert delegate
if (alertView.tag == kDeleteAlertTag)
{
if (buttonIndex == 0)
{
[self.emails removeObjectAtIndex:currentIndex];
[self.plistReader saveToPlistName:kPlistEmails fromArray:self.emails];
[self.tblEmails reloadData];
}
}
// remove email alert delegate
if (alertView.tag == kAddEmailTag)
{
if (buttonIndex == 0)
{
// get text Input Alert
UITextField * emailInputTextField = [alertView textFieldAtIndex:0];
// get string from text Alert
NSString *textInput = [emailInputTextField text];
if (self.emails== nil) {
self.emails = [[NSMutableArray alloc]init];
}
if ([textInput isEqualToString:@""]) {
NSLog(@"Not have string");
}else
if ([KUtils NSStringIsValidEmail:textInput] == YES)
{
[self.emails addObject:textInput];
// save to plist and reload table
[self.plistReader saveToPlistName:kPlistEmails fromArray:self.emails];
[self.tblEmails reloadData];
}else if([KUtils NSStringIsValidEmail:textInput] == NO)
{
// not dismiss alert in hre
}
}
}