I made a if statement here where if the textfield contains less then 4 symbols it gives an popup. if the text field is contains more then 4 it should push to a different viewcontroller.
For some reason the push is not working. the pop-up works fine.
Basically the viewcontroller we are on right now is a "first time launch setup page" so I don't want the user to navigate back to it. How can I do that?
Here is my code:
-(IBAction)initialButton:(id)sender {
NSLog(@"initialButton clicked");
if([userEmail.text length] <4)
{
[WCAlertView showAlertWithTitle:@"Email is empty" message:@"You haven't entered an email yet. Please enter one so we can /sent you the shipping labels." customizationBlock:^(WCAlertView *alertView) {
alertView.style = WCAlertViewStyleBlackHatched;
} completionBlock:^(NSUInteger buttonIndex, WCAlertView *alertView) {
if (buttonIndex == 0) {
NSLog(@"Cancel");
} else {
NSLog(@"Ok");
}
} cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
}
else {
ViewController *viewController = [[ViewController alloc] init];
[self.navigationController pushViewController:viewController animated:YES];
}
}