i am getting response like {“nok”} …. now i want to compare this for check status of data sent or not.
this is my code
NSString *responseStr = [sender responseString];
NSLog(@"response string %@", responseStr);
if([responseStr isEqualToString:@"nok"])
{
NSLog(@"Hiii");
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"Attenzione: si è verificato un errore di richiesta del premio." delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
[alert show];
[alert release];
}
else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"Inviato con successo" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
[alert show];
[alert release];
[self startIscrivity2View];
}
it’s always run else part…
please help me
USe the below function of NSString.
The above function will not check for the equality, it will tell u whether your responseStr contain “nok” string OR not ..