Maybe this is common and maybe it’s not, but in the course of my work writing Objective-C for iOS, I end up using CGRectMake()â€”to make, yes, a CGRectâ€”pretty frequently, but I only rarely need to build an NSRange. Â So following the CGRectMake pattern, I inevitably start typing “NSRangeMake” and along the way the only method completion I get is for NSRangeFromString(). Â A few befuddled minutes later, I realize that what I’m looking for is NSMakeRange(), and then I can go back to slowly forgetting about that reversed word order until I run in to the same problem a month or two later. Â Since I really my startÂ programming in PHP, this kind of thing shouldn’t throw me, but it does.
So on the off chance that this happens to you, too, here you go:
#define NSRangeMake(location, length) NSMakeRange(location, length)
I wouldn’t recommend actuallyÂ using NSRangeMake() in code anywhere, but this will at least give you a little reminder.