The correct way to do this from iOS 9 onwards, is:
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
numberFormatter.numberStyle = NSNumberFormatterOrdinalStyle;
NSLog(@"%@", [numberFormatter stringFromNumber:@(1)]); // 1st
NSLog(@"%@", [numberFormatter stringFromNumber:@(2)]); // 2nd
NSLog(@"%@", [numberFormatter stringFromNumber:@(3)]); // 3rd, etc.
Alternatively:
NSLog(@"%@", [NSString localizedStringFromNumber:@(1)
numberStyle:NSNumberFormatterOrdinalStyle]); // 1st
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…