辞書操作の方法を知っていると仮定すると、文字列内の要素を交換する 1 つの方法を次に示します。
NSString* name = @"Firstname, Lastname";
// Remove the space after comma (not necessary if you know the name will always
// have a space after comma, then just split on ', '.
NSString* normalizedName = [name stringByReplacingOccurrencesOfString:@", " withString:@","];
// Split the string on ','.
NSArray* nameParts = [normalizedName componentsSeparatedByString:@","];
// Reverse the array
NSArray* reverseNameParts = [[nameParts reverseObjectEnumerator] allObjects];
// Join the array with ', '
NSString* revname = [reverseNameParts componentsJoinedByString:@", "];
NSLog(@"Reversed name parts: %@", revname);