Skip to content

Instantly share code, notes, and snippets.

@patzearfoss
Created September 30, 2014 13:41
Show Gist options
  • Save patzearfoss/c80d25ef11596c3f172a to your computer and use it in GitHub Desktop.
Save patzearfoss/c80d25ef11596c3f172a to your computer and use it in GitHub Desktop.
+- (void)willSave
+{
+ static const unichar kUnicharMax = USHRT_MAX;
+ NSString *heavyString = [NSString stringWithCharacters:&kUnicharMax length:1];
+
+ self.firstNameSortValue = [self.firstName length] ? self.firstName : heavyString;
+ self.lastNameSortValue = [self.lastName length] ? self.lastName : heavyString;
+ self.companySortValue = [self.company length] ? self.company : heavyString;
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment