CMD+Click to your objectForKey
statement. Xcode will find the method at NSDictionary.h.
Now change your code like
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
...
NSLocale *currentLocale = [NSLocale currentLocale];
formatter.groupingSeparator = [currentLocale objectForKey:NSLocaleGroupingSeparator];
and CMD+Click again to this objectForKey
statement. Xcode will go to correct place, NSLocale.h.
Or, as you suggested, you can just force-cast NSLocale like
formatter.groupingSeparator = [(NSLocale *)[NSLocale currentLocale] objectForKey:NSLocaleGroupingSeparator];