It makes me send a request to a php script on a website and after that it writes in the console the string returned from the script.
I want to change a bit the app.
I want to write inside the console a text depending on the answer received from the php script.
By now I use this code to write inside the console
NSURLResponse* response; NSError* error; NSData* risultato = [NSURLConnection sendSynchronousRequest:richiesta returningResponse:&response error:&error]; NSLog(@"%@", [[[NSString alloc] initWithData:risultato encoding:NSASCIIStringEncoding] autorelease]);
The script returns "ok" or "ko", and I read it correctly inside the console.
I need to add something like
if("the response received from the script" is equal to "ok"){
//text for ok
}
else {
//text for ko
}
My problem is what to write for the "if" condition.
How can I make that comparison?

New Topic/Question
Reply


MultiQuote



|