Xcode log输出中文
2016-07-26 17:47
405 查看
直接添加一个分类输出中文 在PrefixHeader.pch import即可。
//NSArray+Log.h #import <Foundation/Foundation.h> @interface NSArray (Log) - (NSString *)descriptionWithLocale:(id)locale; @end @interface NSDictionary (Log) - (NSString *)descriptionWithLocale:(id)locale; @end //NSArray+Log.m #import "NSArray+Log.h" @implementation NSArray (Log) - (NSString *)descriptionWithLocale:(id)locale { NSMutableString *strM = [NSMutableString stringWithString:@"(\n"]; for (id obj in self) { [strM appendFormat:@"\t%@,\n", obj]; } [strM appendString:@")\n"]; return strM; } @end @implementation NSDictionary (Log) - (NSString *)descriptionWithLocale:(id)locale { NSMutableString *strM = [NSMutableString stringWithString:@"{\n"]; [self enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { [strM appendFormat:@"\t%@ = %@;\n", key, obj]; }]; [strM appendString:@"}\n"]; return strM; } @end
相关文章推荐
- 教你如何解决XCODE升级后插件不能用问题
- 浅谈Xcode 开发工具 XCActionBar
- xcode 4 制作静态库图文详解
- 使用Xcode为iOS应用项目创建PCH文件的方法及应用示例
- 解决 Xcode 6-Beta2 智能提示bug
- 针对iOS开发的一些Xcode使用技巧小结
- Xcode中iOS应用开发的一般项目目录结构和流程简介
- XCode编译速度慢的处理方法
- mac git xcrun error active developer path 错误
- Xcode使用教程详细讲解(全)
- Cocos2d开发1:Xcode与TexturePacker的集成
- windows下objective-c的cocoa框架编程,可以有图形界面哟
- Xcode控制台命令
- 【卡片记忆】快速启动iOS模拟器
- OSX下Xcode更新后,Git提示确认证书
- 解决Xcode symbol not found问题
- Xcode5.0.2 资源更新问题
- Xcode7升级到Xcode8之后遇到文件冲突
- WWDC2016 Session笔记 - Xcode 8 Auto Layout新特性
- Xcode 8 的 6 大新功能一览