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.
NSutf8stringencoding
Try the following - there could be additional whitespace characters in the strResult (like carriage returns):
if ([strResult rangeOfString:@"1"].length > 0) { // Do something... }