I want that when user enter wrong value in the textfiled it shows alert and it makes textfield emty and also the button title to empty.In my code textfield empty is done but button is not getting the empty values
below is the my code
if (monthText>totalnumber) {
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Warning" message:@"Value Must Be Less than total number of dogs " delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
NSString *titleMonth =@"0";
[cereniaButton setTitle:@"" forState:UIControlStateNormal];
cereniaTextField.text=@"";
}
int year=12;
int monthButtonTitle=monthText*year;
NSString *titleMonth =[NSString stringWithFormat:@"%d",monthButtonTitle];
[cereniaButton setTitle:titleMonth forState:UIControlStateNormal];