Objective c 目标-c为什么nslog在双引号之间显示字符串&引用;?

Objective c 目标-c为什么nslog在双引号之间显示字符串&引用;?,objective-c,nsarray,nslog,Objective C,Nsarray,Nslog,我正在从文本文件加载nsarray: NSArray *noWords = [[NSArray alloc] initWithArray: [[NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"untitled" ofType:@"txt"] enc

我正在从文本文件加载nsarray:

NSArray *noWords = [[NSArray alloc] initWithArray:
                        [[NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"untitled" ofType:@"txt"]
                                                   encoding:NSUTF8StringEncoding error:NULL] componentsSeparatedByString:@"\n"]];
Untitled.txt包含:

alfa
beta (geologi).
beta
jaha
javel
jam (geologi) en
jamen
jamen
jamen
jax. (geologi)jammen
det
var
æhæhæ
øhøh
på
tide
.(geologi),be;ta;
tiden
men
but
men
aha
beta
NSLog(@“noWords:%@”,noWords);显示:


当字符串中有空格或其他特殊字符时,它会执行此操作。请注意,这正是
NSLog()
所做的。执行
[NSString stringWithFormat:…]时不会发生这种情况。

如果字符串中有空格或其他特殊字符,则会发生这种情况。请注意,这正是
NSLog()
所做的。当您执行
[NSString stringWithFormat:…]
操作时,不会发生这种情况。

stackoverflow.com/questions/7227163/nslog奇怪行为/72272757227275stackoverflow.com/questions/7227163/nslog奇怪行为/7227275
2011-08-29 16:16:44.288 scanner2[30177:207] noWords : (
alfa,
"beta (geologi).",
beta,
jaha,
javel,
"jam (geologi) en",
jamen,
jamen,
jamen,
"jax. (geologi)jammen",
det,
var,
"\U00e6h\U00e6h\U00e6",
"\U00f8h\U00f8h",
"p\U00e5",
tide,
".(geologi),be;ta;",
tiden,
men,
but,
men,
aha,
beta