标签:des style class blog c code
NSArray+Log.m
1 #import "NSArray+Log.h" 2 3 @implementation NSArray (Log) 4 5 - (NSString *)descriptionWithLocale:(id)locale 6 { 7 // 遍历数组中的所有内容,将内容拼接成一个新的字符串返回 8 NSMutableString *strM = [NSMutableString string]; 9 10 [strM appendString:@"(\n"]; 11 12 // 遍历数组,self就是当前的数组 13 for (id obj in self) { 14 // 在拼接字符串时,会调用obj的description方法 15 [strM appendFormat:@"\t%@,\n", obj]; 16 } 17 18 [strM appendString:@")"]; 19 20 return strM; 21 } 22 23 @end
做NSArray分类,能正常显示中文,布布扣,bubuko.com
标签:des style class blog c code
原文地址:http://www.cnblogs.com/wentianblog/p/3750500.html