Skip to content

Commit 34ee8de

Browse files
committed
update post
1 parent 082e82a commit 34ee8de

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎_posts/2017-03-01-Xcode-控制台输出中文.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ tags:
1212
- macOS
1313
---
1414

15-
> 重写 Array、Set、Dictionary 的输出方法,实现在中文(Unicode)字符在控制台的输出
15+
> 重写 NSArray、NSSet、NSDictionary 的输出方法,在Xcode实现中文(Unicode)字符在控制台的输出
1616
1717
## 原理
18-
Xcode 控制台中在输出 Array、Set、Dictionary 时,其中的中文字符会变成Unicode编码 如`"\U67cf\U8367"`,重写输出方法
18+
Xcode 控制台中在输出 NSArray、NSSet、NSDictionary 时,其中的中文字符会变成Unicode编码 如`"\U67cf\U8367"`.
19+
20+
我们通过分类重写这些类的输出方法即可实现在控制台输出中文:
1921

2022
- (NSString *)descriptionWithLocale:(id)locale indent:(NSUInteger)level
2123

0 commit comments

Comments
 (0)