You can use else if condition.
Like this :
-(IBAction)done {
if ([entry.text isEqualToString:sentance.text]) {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Cleared!"
message:@""
delegate:nil
cancelButtonTitle:@"Ok"
otherButtonTitles: nil];
[alert show];
[alert release];
seconds.text = @"5 Seconds";
}
else if ([entry.text isEqualToString:entry.text]) {
NSString *nssScore= [NSString stringWithFormat:@"Final Score: \n %i Points", Score];
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Nope! Wrong"
message:nssScore
delegate:nil
cancelButtonTitle:@"Ok"
otherButtonTitles: nil];
[alert show];
[alert release];
}
}
or you can add a line of code in each block "return;"
like this: