Hi guys,
Here is a problem with my textfields.
-(void)textFieldTextDidChange:(NSNotification *)notif
{
event.eventName = eventTextField.text;
event.eventPlace = eventPlaceTextField.text;
event.eventWinery = wineryTitleLabel.text;
int vintageVal = [vintageTextField.text intValue];
if([vintageTextField.text length]>0 && [vintageTextField.text length] == 4)
{
event.eventVintage = vintageVal;
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"!!! MESSAGE !!!"
message:@" Enter the Valid year in Format YYYY"
delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
return;
}
}
here if the user enters the year with four digits then only it shoulb be saved into event.eventVitage. But here when in entering every single number im getting the alerview. How can i get out of this? guys help me to solve this.
MONISH KUMAR