I need to compare a string from an url using NSutf8stringencoding
in order to return 1 or 0, but it always returns 0 even if the string has value 1.
Try the following - there could be additional whitespace characters in the strResult (like carriage returns):
if ([strResult rangeOfString:@"1"].length > 0) {
// Do something...
}
There are probably other characters in the string.
Use
[strResult stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];