Я не знаю, почему произошла эта ошибка. Я исправил это так:
-(id)init{
self=[super init];
if(self){
NSArray *codes=[NSArray arrayWithObjects:@"\\u0410",@"\\u0411",@"\\u0412",@"\\u0413",@"\\u0414",@"\\u0415",@"\\u0416",@"\\u0417",@"\\u0418",@"\\u0419",@"\\u041a",@"\\u041b",@"\\u041c",@"\\u041d",@"\\u041e",@"\\u041f",
@"\\u0420",@"\\u0421",@"\\u0422",@"\\u0423",@"\\u0424",@"\\u0425",@"\\u0426",@"\\u0427",@"\\u0428",@"\\u0429",@"\\u042a",@"\\u042b",@"\\u042c",@"\\u042d",@"\\u042e",@"\\u042f",
@"\\u0430",@"\\u0431",@"\\u0432",@"\\u0433",@"\\u0434",@"\\u0435",@"\\u0436",@"\\u0437",@"\\u0438",@"\\u0439",@"\\u043a",@"\\u043b",@"\\u043c",@"\\u043d",@"\\u043e",@"\\u043f",
@"\\u0440",@"\\u0441",@"\\u0442",@"\\u0443",@"\\u0444",@"\\u0445",@"\\u0446",@"\\u0447",@"\\u0448",@"\\u0449",@"\\u044a",@"\\u044b",@"\\u044c",@"\\u044d",@"\\u044e",@"\\u044f",
@"\\u0401",@"\\u0451",@"\\u00a0",nil];
NSArray *res=[NSArray arrayWithObjects:@"А",@"Б",@"В",@"Г",@"Д",@"Е",@"Ж",@"З",@"И",@"Й",@"К",@"Л",@"М",@"Н",@"О",@"П",
@"Р",@"С",@"Т",@"У",@"Ф",@"Х",@"Ц",@"Ч",@"Ш",@"Щ",@"Ъ",@"Ы",@"Ь",@"Э",@"Ю",@"Я",
@"а",@"б",@"в",@"г",@"д",@"е",@"ж",@"з",@"и",@"й",@"к",@"л",@"м",@"н",@"о",@"п",
@"р",@"с",@"т",@"у",@"ф",@"х",@"ц",@"ч",@"ш",@"щ",@"ъ",@"ы",@"ь",@"э",@"ю",@"я",
@"Ё",@"ё",@" ",nil];
dic=[[NSMutableDictionary alloc] initWithObjects:res forKeys:codes];
}
return self;
}
-(NSString*)convertToString:(NSString*)str{
if(str==nil)
return nil;
NSString *new_str=str;
for (NSString *s in [dic allKeys]) {
new_str=[new_str stringByReplacingOccurrencesOfString:s withString:[dic objectForKey:s]];
}
return new_str;
}