Can someone explain what location and length represent for NSRange.
If I use it in this context
NSRange range = [self.display.text rangeOfString:@"."];
if(range.location == NSNotFound){
self.display.text = [self.display.text stringByAppendingString:@"."];
What does the location represent and can someone explain this code. Also where can I find more information on properties such as location> I found it in the header file as an NSUInteger but it doesn’t describe what location actually does.
According to the official doc:
So your code will append the string your are testing with ‘.’ if this character was not found in it.