NSString *result = nil;
if([result rangeOfString:@"SUCCESS"].location != NSNotFound)
{
NSLog(@"Location: %lu", [result rangeOfString:@"SUCCESS"].location);
NSLog(@"Length: %lu", [result rangeOfString:@"SUCCESS"].length);
}
else{
NSLog(@"NULL found: %@", result);
}
this code shows output:
2016-05-12 18:51:44.589 TestProject[21666:207505] Location: 0
2016-05-12 18:51:44.590 TestProject[21666:207505] Length: 0
Actually It should show output:
NULL found: (null)
Please explain the reason of that output