Xcode调试打印方法
2013-03-21 11:27
253 查看
1 NSLog
在调试的过程中,最常用的查看变量值的方法是NSLog
整数 int a = 1; NSLog("%d", a);
浮点数 float b = 1.11; NSLog("%f", b);
字符串 NSString *str = @"abc"; NSLog("%@", str);
数组 NSArray *arr = [NSArray arrayWithObjects:@"abc", @"def", @"ghi", nil]; NSLog("%@", array);
字典 NSDictionary *dict = [NSDictionary dictionaryWithObject:@"abc" forKey:@"123"]; NSLog("%@", dict);
2 print
在调试的过程中,可以在底部All Output窗口中使用print来打印整型、浮点型、布尔型的值,比如print bgImage.size.height
3 po
在调试的过程中,可以在底部All Output窗口中使用po来打印对象的值,比如po self.view
在调试的过程中,最常用的查看变量值的方法是NSLog
整数 int a = 1; NSLog("%d", a);
浮点数 float b = 1.11; NSLog("%f", b);
字符串 NSString *str = @"abc"; NSLog("%@", str);
数组 NSArray *arr = [NSArray arrayWithObjects:@"abc", @"def", @"ghi", nil]; NSLog("%@", array);
字典 NSDictionary *dict = [NSDictionary dictionaryWithObject:@"abc" forKey:@"123"]; NSLog("%@", dict);
2 print
在调试的过程中,可以在底部All Output窗口中使用print来打印整型、浮点型、布尔型的值,比如print bgImage.size.height
3 po
在调试的过程中,可以在底部All Output窗口中使用po来打印对象的值,比如po self.view
相关文章推荐
- [iOS]Xcode4/iOS5调试UncaughtException崩溃First throw call stack不打印方法名的解决方案
- [iOS]Xcode4/iOS5调试UncaughtException崩溃First throw call stack不打印方法名的解决方案
- Xcode4/iOS5调试UncaughtException崩溃First throw call stack不打印方法名的解决方案
- Xcode4/iOS5调试UncaughtException崩溃First throw call stack不打印方法名的解决方案
- Xcode调试打印方法
- [iOS]Xcode4/iOS5调试UncaughtException崩溃First throw call stack不打印方法名的解决方案
- Xcode调试打印方法
- [iOS]Xcode4/iOS5调试UncaughtException崩溃First throw call stack不打印方法名的解决方案
- 调试MTK mmi程序时通过debug口打印调试信息的方法
- Xcode4.3.2真机调试NSLog无法输出中文的解决方法
- 【Xcode使用技巧】Xcode调试方法
- codeigniter发送邮件并打印调试信息的方法
- Xcode调试攻略(5种方法)
- Xcode 真机调试中"There was an internal API error"错误解决方法
- Xcode 真机调试 ineligible Devices的解决方法
- Xcode中lldb的REPL调试方法
- 这是个用来确认当前是否是调试模式然后判断是否需要打印日志的很好的方法,具体链接不知道,但是很感谢作者
- 快速解决低版本Xcode不支持高版本iOS真机调试的问题方法
- Xcode真机调试中"There was an internal API error"错误解决方法
- Android下打印调试堆栈方法总结以及strace工具使用