我在重写description方法,在字符串中需要有换行,但是/n
和/r
都不工作。
代码:
- (NSString *)description
{
return [NSString stringWithFormat:@"some text: \r some more text - %@",@"more text"];
}
然后我试了这样:
- (NSString *)description
{
return [NSString stringWithFormat:@"some text: \n some more text - %@",@"more text"];
}