You cannot call that without the dot.
rangeOfCharacterFromSet
returns a NSRange
, which is a plain C struct:
typedef struct _NSRange {
NSUInteger location;
NSUInteger length;
} NSRange;
and not an Objective-C object. .location
accesses the first member of that struct
and is pure C syntax.
That has nothing to do with the dot-notation for properties, or with method calls.