I am making a server call in some Objective-c code. If it returns as a @"yes"
, it will do an action. For some reason, the // DO ACTION HERE
part is never reached.
NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];
NSString *returnStringResults = returnString;
NSString *yesText = @"yes";
if (returnStringResults == yesText) {
testLabel.text = @"Success";
// DO ACTION HERE
}
See Question&Answers more detail:os