0
点赞
收藏
分享

微信扫一扫

Xcode调试打印方法



1 NSLog

在调试的过程中,最常用的查看变量值的方法是NSLog

整数

浮点数

字符串

数组 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

举报

相关推荐

0 条评论