我对编程很陌生。我希望你们能帮助我。一些土耳其字母被视为0或只是在我的4个图片1字应用程序中按下的字母上是空的。 Ü,Ç,Ö字母没有问题,但Ş,İ和Ğ字母在这里有问题。在这里,我将分享有关从名为letters_to_press的文本文件中提取字母的代码。
-(void)PopulatePoolOfLettersToPress
{
//[poolOfLetters addObject:@"ASNEQITSUEJDTT"];
NSString* path = [[NSBundle mainBundle] pathForResource:@"letters_to_press" ofType:@"txt"];
NSString* words = [NSString stringWithContentsOfFile:path
encoding:NSUTF8StringEncoding
error:NULL];
poolOfLetters = (NSMutableArray*)[words componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]];
for (int i = 0; i < [poolOfLetters count]; i++)
{
NSString *letter = [poolOfLetters objectAtIndex:i];
NSString *newLetter = [letter uppercaseString];
[poolOfLetters replaceObjectAtIndex:i withObject:newLetter];
}
}