This is also called the lookup table and can be used instead of switch / case or if / else in such situations.
That is, the code creates an NSArray (from NSString) for use as a search, and then retrieves the string at the specified ordinal position - for example, Ace ("A") is rank 1, and king ("K") is rank 13.
Consider whether the code was written as:
NSArray* array = @[@"?", @"A", ..., @"K"];
return array[self.rank];
, . @[..], @".." array[..] Clang
OBJECTIVE-C ; Apple LLVM Compiler 4.