I am facing a weird problem.
I have a UITextField and an NSString which I want to compare using the isEqualtoString method.
As long as the Strings don’t include German Umlaute such as Ä,Ö,Ü everything works fine but if they do it doesn’t work anymore.
NSLog gives out the Umlaute-Strings correctly.
NSLog([currentAnswer lowercaseString]);
NSLog([[self.antwortTextField text]lowercaseString]);
if ([[currentAnswer lowercaseString] isEqualToString:[[self.antwortTextField text]lowercaseString]]) {......}
Do I have to format the Strings somehow? This problem is driving me insane!
You can use an advanced
NSStringcomparison method, such as:and then specify advanced options. Specific options you may be interested in:
NSCaseInsensitiveSearchNSDiacriticInsensitiveSearchNSWidthInsensitiveSearch