I watched some WWDC videos on the basic data, and I plan to preserve the canonicalized text property. Let's say I have the following data:
originalString normalizedString (+lowercase?) Γnsker onsker onsker onsker Onsker onsker
When I request my model, I want to sort it by "normalizedString" so that it ignores case and character (or other characters). I also want to be able to run a query like "starts with" o "and return 3 words to it.
I tried to avoid to do something like:
[NSPredicate predicateWithFormat:@"(originalString like[cd] %@)"...
to request a model. I also tried using "originalString" for my sorting.
I tried two different approaches without success, my normalized string is still saved as originalString (I redefine the setter in the category I created):
Any ideas on how I can achieve my goal?
Edit: Here, my overridden setter that I know is called:
- (void) setNormalizedName:(NSString *)newNormalizedName { NSMutableString *normalizedString; if (![self.lastName length] == 0) { normalizedString = [NSMutableString stringWithString:self.lastName]; } else { normalizedString = [NSMutableString stringWithString:self.firstName]; }
source share