I have a string that is set to a HTTP response. When I print the value to the console, it tells me it is -1. However, it is not working when I compare the string to @"-1". Is it possible that there is hidden information being encoded from the HTTP response?
Code:
NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];
if([returnString isEqualToString:@"-1"]){
NSLog(@"works");
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:nil message:@"That username is already in use."
delegate:self cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
}