여러 단어의 배열을 만든 다음 모든 단어를 변경 가능한 문자열에 넣은 다음이 문자열의 모든 문자를 변경할 수있는 배열을 넣습니다. 그러나, 그 문자의 가변 어레이 로그에서 보여 시뮬레이터에서 애플리케이션의 각각의 시작시에 랜덤 스크램블링 된 문자를 제공한다 "wordSplitted"iOS NSMutableString은 이상한 문자를 반환합니다.
2012-07-22 09:12:01.108 xxx[4484:b603] wordSplitted contains: (
"",
"",
"\U221e",
"-",
G,
N,
P,
"",
""
)
그것은 ㄴ한다, I, L, H, U, k, s, k, j.
NSArray *threeWords = [NSArray arrayWithObjects:@"bil", @"huk", @"skje", nil];
NSMutableString *allTogether = [[NSMutableString alloc]init];
/*
for (NSString *s in threeWords)
{
[allTogether appendString:s];
}
*/
for (int b = 0; b < [threeWords count]; b++)
{
[allTogether appendString:[threeWords objectAtIndex:b]];
}
NSLog (@"allTogether contains %@", allTogether);
//[threeWords release];
[allTogether release];
NSMutableArray *wordSplitted = [[NSMutableArray alloc]init];
//this function gives me headache
for (int a = 0; a < 9; a ++)
{
//gives also scrambled characters
//[wordSplitted addObject:[NSString stringWithFormat:@"%C",[allTogether characterAtIndex:a]]];
NSRange range = {a,1};
[wordSplitted addObject:[allTogether substringWithRange:range]];
}
NSLog (@"wordSplitted contains: %@", wordSplitted);
어떻게 알파벳과 같은 일반 문자를 표시 할 수 있습니까?
당신 말이 맞아! 너무 잠이 거의없는 것 같아요. – wagashi