-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxcodeCNLog.m
More file actions
36 lines (31 loc) · 1.02 KB
/
xcodeCNLog.m
File metadata and controls
36 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// NSDictionary+CNLog.m
// NetworkTest
//
// Created by 周超 on 2016/12/16.
// Copyright © 2016年 周超. All rights reserved.
//
#import "xcodeCNLog.h"
@implementation NSDictionary (CNLog)
-(NSString *)descriptionWithLocale:(id)locale{
NSMutableString * str=[NSMutableString string];
[str appendString:@"\t{\n\t"];
[self enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
[str appendString:[NSString stringWithFormat:@"\t%@:",key]];
[str appendString:[NSString stringWithFormat:@"%@;\n\t",obj]];
}];
[str appendString:@"},"];
return str;
}
@end
@implementation NSArray (CNLog)
-(NSString *)descriptionWithLocale:(id)locale{
NSMutableString * str=[NSMutableString string];
[str appendString:@"(\n\t"];
[self enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
[str appendString:[NSString stringWithFormat:@"%@\n\t",obj]];
}];
[str appendString:@")"];
return str;
}
@end